The previous statement is almost heresy in the Ruby community. Don’t get me wrong, you should own the Pickaxe. It’s a great book and certainly lives up to it’s description as “the definitive reference to Ruby”. However it’s much more of a reference book than an introduction to the language. And it’s huge - 864 pages. This is not a book you can just throw in your bag and carry around with you. It’s a book you would keep at your desk perhaps, dog-eared and coffee stained. In this role, it is ideal. As an introduction to the language, however, it leaves something to be desired.
Beginning Ruby, on the other hand, is an excellent (and I would argue more approachable) introduction to the Ruby language, written by one of it’s more notable users. Peter Cooper is well known, in both the Ruby and Rails community. He runs the Ruby-centered blog Ruby Inside, and has developed a number of applications in Rails, including the Snippets code repository, which was subsequently sold to DZone. Peter also has done a fair amount of writing over the years for a variety of sites.
The book is broken up into three primary sections, plus a handful of appendices:
- Part 1: Foundations and Scaffolding - This is an introduction to the Ruby language. Starting with installation, and going through the basic structure of the language and it’s elements: strings, containers, and the like. There is a chapter on building basic Ruby programs that puts all of these concepts together. One nice bonus was a chapter on the Ruby ecosystem, which covers the various websites, irc channels, and other resources for Ruby developers.
Part 2: The Core of Ruby - This section covers the meat and potatoes of Ruby. It covers classes, modules, libraries, debugging and testing, databases, and advanced features. This is all tied together with a nice example application that implements a text-parsing bot. I liked that this application included unit tests, but it would have been nice if the testing was done test-first. This is a personal preference, but I think it’s a best practice and would like to see it demonstrated more in books like this.
Part 3: Ruby Online - As you would expect, this section includes some coverage on Rails. Its not exhaustive, and isn’t intended to replace a full-blown book on Rails. It does offer a thorough overview though. That’s not the sole focus of this section, however. Ample coverage is given to FTP, HTTP, and email, as well as raw TCP sockets and other networking type things. There is also a good chapter in here called “Useful Ruby Libraries and Gems”. The chapter itself is a bit misplaced as it has very little to do with the internet, but it is a very useful overview of a lot of the third party gems that you can install. I found myself using this section regularly on a recent project.
In addition to these sections, there are three appendices. The third appendix, called “Useful Resources” contains pointers to a lot of online resources which would likely be unknown to someone new to Ruby. I didn’t find much in there I hadn’t seen already, but I’ve been using Ruby for a little while. The first two appendices are a primer and reference for Ruby. These are both very good, and would be useful as references for a new developer (or someone who doesn’t have the entire ruby syntax committed to memory yet, like me).
Weighing in at over 600 pages, this is a comprehensive book. At the same time, it’s quite a bit smaller than the Pickaxe, which makes it much more portable (there’s also a PDF version available for $10 if you’ve purchased the dead-tree edition, for the ultimate in portability).
As with the last book I reviewed, this one appears to have been well technical reviewed. I didn’t notice any errors. I also enjoyed Peter’s writing style, which is concise but not dry.
In summary, if you want to learn Ruby, Beginning Ruby: From Novice to Professional is the book to buy.
Disclaimer: I received a free copy of this book from the publisher in exchange for a review. There were no conditions other than that, but in the interest of full disclosure, now you know.