Want to stay on top? Ruby Weekly is a once-weekly e-mail newsletter covering the latest Ruby and Rails news.
     Feed Icon

The New Most Important Ruby Book: O’Reilly’s “The Ruby Programming Language”

By Peter Cooper / February 26, 2008

hummingbird-book-the-ruby-programming-language.png

Originally planned as a second edition to Ruby classic, Ruby In A Nutshell, The Ruby Programming Language is a new book by David Flanagan and Yukihiro Matsumoto (a.k.a. Matz - creator of Ruby) and published by O'Reilly. The book covers Ruby 1.8 and 1.9 and with its esteemed authors and technical approach, is sure to become a new "Bible" for Ruby developers. In programming book style, I'm going to refer to it as the "Hummingbird" book in future, due to the woodcut pictures of hummingbirds on the front.

It's excellent..

Only coming into stock two weeks ago, this book is fresh and up to date. Its style is very direct and matter-of-fact; well suited for existing Ruby developers and proficient developers coming from other languages. The examples are clear and logical and the explanations concise; this is a well edited and authoritative book.

The structure of the book is a delight with ten well-defined chapters (with titles such as Reflection and Metaprogramming, Statements and Control Structures, and Expressions and Operators) that each contain a tree of sections. Consider Chapter 4, Expressions and Operators. A sample dive down to section 4.5.5.2 takes us through 4.5, Assignments; 4.5.5, Parallel Assignment; and finally to 4.5.5.2, One lvalue, multiple rvalues. This is a breath of fresh air in a Ruby reference work.

.. but it's not exhaustive, and that's a good thing.

The only downside, in terms of the thousands who might be browsing Amazon looking for a single Ruby book to start off with, is that the Hummingbird is so well focused on documenting the core elements of the Ruby language, it doesn't work either as a tutorial / beginner's introduction to Ruby, or as an exhaustive reference work (as, on both fronts, the Pickaxe attempts to be.) This lack of dilution may be an ultimate strength, however, since anyone above the station of "beginner" will be able to learn Ruby thoroughly from this book, use it as a general reference, and then be able to use the exhaustive documentation that comes with Ruby itself to cover the standard library and built-in classes. That's a hard message to get across though, so I beseech you, recommend this book to the newcomers!

Get this, the Ruby Way, and use the Ruby documentation, and you're done.

In conclusion, the Hummingbird deserves to be on your bookshelf, whether you're a seasoned developer looking to learn Ruby, or an existing Ruby developer who just wants a great core-language reference. This, and The Ruby Way, are the top two Ruby books out there right now. Unless you really want a gigantic, overreaching, tutorial-cum-stagnant-reference all in one, forget Programming Ruby (the Pickaxe) and:

  1. get this book
  2. get The Ruby Way
  3. use the up-to-date reference materials from Ruby directly.

It's the perfect Ruby book-and-documentation trifecta and it'll last you for years.

Comments

  1. Jeremy says:

    I think this book good but it has a lot of rough spots, especially in the examples. Many of them don't conform to good Ruby style (using "string" + var + "string" instead of "string #{var} string" was a common one I remember). The writing also varies throughout, from rather in depth to cursory and almost lacking in other parts.

    All in all, though, I agree with you, and I think it's a great book that will get info on 1.9 out there for others to pick up on.

  2. Juixe Techknow says:

    But if you need to choose just one book, The Ruby Programming Language or The Ruby Way, which would it be? Is The Ruby Way recommended more for more advanced users?

  3. Peter Cooper says:

    If you're already pretty confident you know most of Ruby's syntax and you can ONLY get one book, get The Ruby Way, simply because it'll extend your knowledge a lot further.

  4. Forth says:

    good start to trash the pixaxe and get ride off pragdave \(^o^)/

  5. Richard says:

    but what about your book peter? :-D

  6. Peter Cooper says:

    Richard: My book isn't being mentioned amongst all of this because my opinions here are true and unbiased, and mentioning my book would, quite rightly, make it look like I have an agenda or be attempting a PR coup for my own material, which I'm not.

    My book's sales are actually increasing in their fourth quarter and we're going to another printing next week. Since I cannot compete entirely with the "herd" mentality that buys an inferior book, and since I don't want to damage my integrity, I'm recommending this new approach (the 2 books + documentation route) for "existing Ruby developers and seasoned developers from other languages," and clearly not specifying an angle for beginners ;-)

  7. Peter Cooper says:

    All that said, in separate posts I can promote as I like, but I haven't tended to promote my book heavily here anyway. :)

  8. James says:

    I strongly disagree about the Pickaxe. Programming Ruby is one of the best programming tutorials I've ever read. I found it both educational and inspirational. I wish I had the equivalent book when I learned Perl and Java.

  9. Peter Cooper says:

    Really? Interesting!

  10. Karel says:

    "trash the pickaxe" etc -- hmm, I just don't get all this Pickaxe bashing. What's the motivation? "Beginning Ruby" is several layers of awesomeness superior to Pickaxe for the beginning Rubyists. That's just not a question, it's a fact. So what?

    Pickaxe was here for everyone when they've been hacking in Perl, PHP, Java, whatever and started to be interested this "bizzare language", this dialect, in 2005 or later when everybody started talking about Rails.

    Karel

Other Posts to Enjoy

Twitter Mentions