Book Review: The Ruby Programming Language
May 19, 2008This past month, I've had the opportunity to read through O'Reilly's new Ruby book, The Ruby Programming Language; thanks to OCRuby and O'Reilly for providing the book.
Now before I share my opinions on this book, let me give you a quick background about me and my programming history just so you have a better understanding of where I'm coming from. I'm a 21 year old college student studying Information & Computer Science at UCI. I've been programming for about 7 years now: first in PHP, then a bit of Java, and for the past 2 years Ruby. I've worked professional in Rails, done numerous Rails projects working for myself (the most recent which recently launched is UselessHypothetical.com), worked on school projects in Ruby (AI project class, operating systems project class), solved several project euler problems using Ruby, and of course written tons of small Ruby scripts as utilities and for fun. I feel I have a pretty good understanding of the Ruby language ranging from syntax to standard library to those 'gotchas' that most (dare I say all) languages have. Alright, enough with the boring stuff, time to get to the book.
For those of you that don't know: Ruby was created by Yukihiro Matsumoto (a.k.a "Matz"). Fortunately, Matz is also the co-author of this book, which is awesome because well, he probably knows the language better than anyone. I don't know it's because of Matz or if it's just coincidence, but this book is incredibly thorough. In the third chapter, "Datatypes and Objects", I learned quite a bit about the nitty gritty of Ruby's syntax and how some of the built-in classes work. For example, I'd seen this syntax a lot:
1 %Q{This string is quoted and can have "quotes" without a problem}
But did you know that it doesn't have to be braces that surrounds the string?
1 %Q^This string is quoted and can have "quotes" without a problem^
Yea, I didn't know that. Also, did you know that there is Ruby syntax for single character codes?
1 ?a # => 97, the character code for 'a'
Anyway, there were tons of small things like that in this chapter that were new to me including fun facts about how the Strings, Ranges, Hashes, and Symbols work. One of the great things about how the book is structured is how it avoids bombarding you with out-of-context standard library methods and usages; each chapter/section gets to the point and stays on topic.
The later chapters get into more advanced topics such as lambdas, procs, and closures and of course the well-known metaprogramming aspect of Ruby. I didn't get a chance to read each and every paragraph yet but I've skimmed pretty much everything. It's got tons of info jam-packed into all 444 pages and does an amazing job of keeping it all organized and presenting it in a manner that can be easily understood.
Throughout the book, there are sections that include explanations about how something is changing from Ruby 1.8 to Ruby 1.9, which is helpful for anyone intending to switch to Ruby 1.9 when that is completed and becomes mainstream. Unfortunately, these sections aren't marked by any visual indicator, so skimming for them doesn't work too well.
In conclusion, this book is by far the best Ruby language book I've seen yet and extensively covers Ruby and it's mainly features. It's an easy read, organized into logical chapters, and is relatively short in comparison to the Pickaxe book (864 pages) without losing content.
I recommend this book to:
- experienced programmers looking to learn Ruby
- Ruby programmers who are interested in knowing every-little-thing about Ruby
- Ruby programmers who will be switching to Ruby 1.9
Update: The purpose of this post isn't to educate anyone on what this book contains or what it covers but simply to give you a quick insight into how I enjoyed it and how I found it useful.
Comments
FWIW, I'm pretty certain both of those did-you-knows are covered in the Pickaxe, because that's where I recall learning them.
I'll probably still pick this book up at some point because hey, it's Matz.
Thanks for the review Arya!
Leave a Comment