Author: Michael Fitzgerald
Publisher: O’Reilly
Published: 2007
Pages: 238
I’ve been wanting to learn a new language for a while, and recently decided to pick up Ruby. I’ve already worked with several C-type languages, including Java, PHP, Perl, and C#, as well as VB and VB.NET. So it was time for something different. The next step, of course, was to get a book to introduce me to the language.
The first chapter introduces the reader to Ruby, explain its origins and its purpose, and provide brief code samples. Instruction is provided for installing Ruby and running Ruby programs. The Interactive Ruby shell is introduced as well, and it promises to be quite useful while exploring the language.
The bulk of the book is divided into chapters covering various topics, from classes to IO to strings to arrays. Each chapter is a cohesive chunk of content that covers the current subject, giving enough detail to make use of the covered feature. I was struck by the similarities that Ruby has to PHP and Perl – some of the syntax samples were very familiar off the bat. Each chapter concludes with several review questions, the answers to which are in the back of the book.
The penultimate chapter was an interesting one, in that it covered a variety of topics that wouldn’t have fit into any of the other chapters. Such topics include XML handling, reflection, metaprogramming (which seems really cool), RubyGems, exceptions, and RDoc (used to generate documentation from code).
The final chapter provides a brief introduction to Rails, which is written in Ruby. I have mixed feelings on this chapter…on one hand, it is a Ruby-related topic, and provides readers a taste of the framework. On the other hand, one chapter hardly does it justice, and the subject is probably best served with a book all on its own.
Appendix A is a Ruby language reference, and it nicely boils down the language constructs into just under twenty pages. There is also some detail of RDoc and Rake. Appendix B contains answers to the chapter review questions.
Overall, this book provides a broad introduction to the Ruby language. It doesn’t have a lot of depth, but it does provide enough detail for a Ruby novice to get started. It looks to have some value as a reference as well, due in part to Appendix A. In the preface, the author declares the intent to have the book be accessible to both novice programmers and to programmers learning Ruby. The book seems to fall a bit flat on the former goal – not everything is fully explained, and may be a problem for someone new to programming.
One other thing: this book is written for Ruby 1.8.6, which is a bit old – the latest is 1.9.1. What I’ve read on the matter is that the current version is not much different, so there shouldn’t be any issues with using code from this book.
The bottom line: Learning Ruby provides a concise introduction to the Ruby language. Those relatively new to programming will need more time to get through this book, but experienced programmers should be able to get through it fairly quickly. In any case, for anyone looking to learn Ruby, I can recommend this book for an easy introduction.

Comments
Sorry, comments are closed.