CodeHappy

November 26, 2006

The Ruby Way

Filed under: General Programming, Ruby On Rails, Tech Opinion — pwrighta @ 1:36 am

The Ruby WayThe Ruby Way came to my attention some time ago as an awesome book to get to start getting ones mind into the Ruby way of thinking. If that sounds a little pretentious (since we’re only talking about a programming language) then trust me when I tell you that it isn’t. Ruby is as different to use daily as C# is from Basic, and it takes a bit of getting into. In fact, a more fitting analogy would be comparing English to Japanese; both are languages used by humans to communicate, and both are fundamentally different in everything from structure to syntax and style.

I’ve found over and over again that as I write code at work, I tend to think in C#. The Ruby way of doing things is invariably far more elegant and succinct and I inevitably come up with ways half the code size in a few days when the Ruby way of working hits home.

Hal Fulton’s awesome book, now in it’s second edition 5 years after the first was released, is a stunning read. It has some quirks (such as much of the content in chapter one obviously referencing code from the first edition), but these are easily forgiveable. As a guide to the Ruby way of doing things, and an aid to get developers of all levels tackling problems from a Ruby perspective, it’s invaluable. At work recently, Dray brought in O’Reilly’s Ruby Cookbook. It strives to serve the reader up with pre-baked solutions to common Ruby problems. Hal’s book looks similar in content, but approaches things from a completely different angle. It’s the ‘Why’ of programming books, as opposed to the Ruby Cookbook’s ‘How’. Given a string for example, The Ruby Way walks you through all the things you would likely want to do to a string, and how to do them the Ruby way. Same thing for database access, Internet access, Regex handling and so on. David Heinemeier Hannson recommends this book as THE book to learn about MetaProgramming, the concept that Ruby embraces that made Rails possible and it’s easy to see why.

The writing style through the book is tight and clean, and Hal is one of those wonderful authors that is able to easily present a new unknown fact to the reader on every single page. This is a fluff free book for those guys that need to get the job done in Ruby now, and it deserves a place on every developer’s shelf.

No Comments Yet »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.