Book Review: Eloquent Ruby

by Justin Spradlin

Eloquent RubyI can’t even begin to imagine how difficult it would be to write a book covering such an in-depth topic as the Ruby Programming language. Add to that a target audience with a widely diverse range of skills and the tasks seems to be out right impossible. Fortunately for us mere mortals Russ Olsen has taken on this challenge and surpassed my high expectations in his second book, Eloquent Ruby.

The first part of the book is for the Ruby newbies, but takes an interesting deviation from most programming books. Instead of focusing simply on the syntax and language libraries, Eloquent Ruby focuses on the community aspect of the Ruby programming language. Each programming community has its own style and norms and without a lot of direction and practice, these style and norms can be difficult to learn. The Ruby community is heavily opinionated and Russ’s book does a great job of explaining these opinions and their manifestation in many Ruby codebases.


Update March 03, 2010:

Due to changes in the Google Finance API only GMoney gem versions >= 0.4.3 are working. If you run gem update gmoney to get the latest version or install the gem from scratch you will be fine.

Let’s pretend the year is 2007 and I have a close “friend” who is really excited about the upcoming 2010 World Cup. My friend is not too naive and realizes that airfare to Africa, lodging, tickets to the games, and Safaris are all very expensive. My friend has a little extra cash to save each month and with a three year time horizon he figures he can stow away a little money in a moderately aggressive mutual fund in order to take advantage of some growth opportunities.

Unfortunately for my friend the next two years would be some of the worst the world economy has ever seen. Like many people, my friend took a bath on his investments and his hopes and dreams of going to the World Cup went down the drain along with his money.

It’s too bad my friend didn’t keep better track of his investments. Perhaps if he had he could have pulled his money out of the stock market and salvaged his vacation. Since my friend is an avid Ruby lover I figured I’d help make sure he doesn’t end up in this situation ever again. That’s why I wrote GMoney, a RubyGem for interacting with the Google Finance API.


Recently I added a Flickr photostream to the footer of the home page of this blog and I thought it would be cool to post an entry on how you can use jQuery and the Flickr API to do the same. Even if you’re not familiar with jQuery or the Flickr API it’s actually quite simple to accomplish this task.


Hello World: 2.0

by Justin Spradlin

Hello and welcome to JustinSpradlin.com (formerly Fiascode.com). This is the personal technology blog and resume site for Justin Spradlin.

The last few weeks of 2009 were spent rewriting this site from the ground up. I hope you like the new design. Come back often for updates or subscribe to the feed to have the latest posts appear directly in your favorite RSS reader.

Happy New Year!

Design Patterns in Ruby

I have a confession to make.

You know that really popular design patterns book that most software developers (especially in the Java world) claim to have read? You know the one I’m talking about. The one written by the “Gang of Four”. The one you were supposed to have read during your junior or senior year of college. Yeah, this one.

I’ve never read it.

Sure, I’ve owned it. I have even thumbed through it a few times. But I’ve never sat down with any real intention of absorbing the information within its covers. The problem for me personally was that when I first opened Design Patterns I was just starting my software development career. I was too young and hadn’t seen enough code to really comprehend the authors’ message or understand the need for such a book.


I am currently in the market to buy my first home so I’ve been spending a lot of time on various real estate websites searching through listings trying to find the perfect property. I live in a competitive housing market so it is important that I am informed whenever a new property becomes available. Logging onto any number of real estate websites to check for new listings each day is very repetitive and time consuming. Fortunately, it is possible to easily gather this information automatically using a technique called screen scraping.

Since most web pages are simply made of HTML it is easy for a computer to parse and store the information contained within these documents. Each programming language commonly has a host of libraries to assist in the screen scraping/parsing process and Ruby is no exception. To create simple screen scrapers in Ruby I have been using a library called scRUBYt!. scRUBYt! provides methods to access a given website and scrape its content. All the programmer needs to do is provide the XPath string to the desired information.

Using the scRUBYt! library has allowed me to write a small screen scraper script to access the FranklyMLS.com website, check for new listings, and then report back with the results. This has saved me a lot of time and effort. Let’s dive into some code to see how this is done.

Pragmatic Thinking and Learning

In order to stay up to speed in an industry that changes by the day developers must constantly be learning and acquiring new skills. As technology fads come and go it is important for developers to isolate and keep pace with the technologies that are in high demand. Because technologies change so rapidly it is important that we are able to learn as quickly and efficiently as possible. While there is certainly no shortage of information available on the latest technologies, making sense of this information, figuring out what is important, and putting this information to use can be a very challenging task. Therefore it is important that developers learn how to learn.

I recently finished the book Pragmatic Thinking and Learning: Refactor Your Wetware by Andy Hunt, co-author of the seminal book The Pragmatic Programmer. In this book Hunt discusses how people (specifically software developers) learn and offers tips on how we can set out to learn more effectively. Here are some useful tips I stumbled upon while reading Pragmatic Thinking and Learning:

Virtualbox Logo

Lately I’ve been interested in learning about a variety of the Operating Systems that are available today. I’m a big advocate of using the right tool for the job so experimenting with the latest OSes is a must in order to figure out the strengths and weaknesses of each. While experimentation is a great way to learn it can be a bit of a pain to find an old machine, format the hard drive, and install an OS. Dual booting is an alternative option, but there is the inherent risk of messing up the current state of your machine.

Overcoming these issues was always a bit of a challenge for me until about six months ago when I stumbled upon VirtualBox. VirtualBox is Sun’s “family of powerful x86 virtualization products.” VirtualBox allows you to install and run “guest” operating systems in their own virtual environment on top of a “host” operating system. I know that virtualization has been around for a while, but until finding VirtualBox, I’ve never had much success running virtualization software. VirtualBox is different. It’s intuitive and easy to use. Here are the top 5 reasons why I love VirtualBox:

The Productive Programmer

Author: Neal Ford
Rating: 3.5/5

As a developer I am constantly seeking ways in which I can improve my ability to quickly generate high quality code so I was excited to pick up Neal Ford’s latest book, The Productive Programmer. This book offers advice on how to accelerate the production and quality of code by exploring many tools and practices that developers can use on a daily basis. In the book, Ford introduces several productivity patterns that can be used immediately, but more importantly he defines a nomenclature that allows developers to construct additional productivity patterns on their own.

The Productive Programmer is broken up into two parts:


In my previous post I introduced Git and discussed its distributed nature, speed, and powerful branching/merging capabilities. Today I’m going to continue the discussion on Git by writing about GitHub, Git in practice, and why Git may not be for everyone.