When reading a programming language book, I look for two things:
- Big ideas: What make this language unique? What styles of programming might it enable?
- Little details: Any interesting language has hundreds of little idioms, tricks, and quirky corners.
When I finally cracked my copy of The Ruby Way (2nd ed.), I did not expect to find much that was new to me--big or little. After all, I have been using Ruby daily for years, and have worn out the electrons in my PDF copy of the Pickaxe. My expectations bumped up a notch when I saw this in the introduction: "[The Ruby Way] was carefully designed to be complementary to [the Pickaxe] rather than overlapping it." When Chapter 1 jumped into reflection, singletons vs. eigenclass, threequals, and
method_missing, I knew I was in for a fun ride.
There is a ton of stuff in The Ruby Way that I have not seen elsewhere in book form. The sections on core classes are not afraid to visit the dimly-lit corners. For example, collection coverage includes not only
inject, but also
partition and how to write your own n-way partition method. This "how to write you own" theme recurs throughout the book, as Hal moves past what Ruby
The Ruby Way covers many things that you might not use every day, but give you a complete utility belt for when you face an unusual challenge. You'll learn about Madeleine, Rinda, ZenTest, GUI toolkits, Rcov, web toolkits (not just R**ls), RMagick, PDF::Writer, and internationalization.
There are a few nits to pick. There could be more about Rake, which is vastly more important than anyone seems to realize. The material on metaprogramming is excellent, but the idioms in a few places are "old school", e.g.
append_features is used where
included is more appropriate in Ruby 1.8+.
I usually take a page or two of notes when reading a book on a familiar topic. With The Ruby Way I took about fifteen pages. There is a lot of good food for thought here. Dig in.