Contents |
By Dave Thomas, with Chad Fowler and Andy Hunt
Ruby has recently become a hot topic in our industry (apologies to all of you long term Ruby users, since you've known how cool Ruby is for some time now) and I went in search of some resources to help me understand Ruby, learn a bit of it and maybe apply it if a need ever arose. After a bit of searching I came upon this title, Programming Ruby, The Pragmatic Programmers' Guide, and it seemed a good choice to use to get my feet wet.
What first caught my attention was that not only was the book available in printed format, but you could also get a softcopy version in PDF format. Now don't get me wrong, I really like to have a physical book in front of me when I first start to learn about a topic, but the option to then place a complete copy on my system and have access to it wherever I might be has always been attractive to me. It's not unusual for me to have 3 or 4 projects in the works at any given time, perhaps covering many different topics. To carry books on all these topics for research and validation has always proved difficult, even just going from work to home and back. Softcopy versions of references like this are a big plus in my book.
Okay, enough rambling about formats, you're here to learn about the actual book, so let's dive right in.
This book is designed to fill two important roles in your library when it comes to Ruby. First, it begins with a very thorough tutorial that will get Ruby installed and lead you through the basics of Ruby programming. From there the authors provide a very detailed Ruby language reference that you will use as you tackle new projects and need a bit more understanding regarding a particular topic. Overall this worked very well and once you have gone through the tutorial, you'll continue to turn to this book as you write more Ruby code.
The first few chapters are basically your standard programming language tutorial and introduction. From variables to classes and objects, the book details the hows and whys with well documented code examples that build as you progress through the book. Many times when using a tutorial of this type the writing is so dry that you sometimes lose interest in the subject matter. Not so with this book. The authors have created the book with a lighter, easier to digest style that makes reading much less of a chore than is typical of tutorial text.
The book spends a bit of time detailing containers, blocks and iterators, which are pointed out as one of the real benefits of writing code in Ruby. In Ruby you typically will create classes that support iteration through their contents rather the standard looping style of many other languages. From here we learn about variables of all types in Ruby, including Ruby's rich support for regular expressions.
The next chapters deal with modules and how to manage reusable code most effectively and then how Ruby handles I/O, not only files but also network I/O.
The chapter on Threads and Processes illustrates how Ruby handles multithreading, thread scheduling and multiprocessing, with very good examples of how they all work and how to most effectively utilize each.
The following chapters deal with testing, debugging and profiling to maximize program performance and reliability. One very useful page lists all of the debugger commands, a page I'm sure each of us will use quite a bit.
Part Two of the book deals with “Ruby in Its Setting.�? The first two chapters cover starting Ruby, command-line options and configuration of the environment for developing and executing Ruby applications.
After a chapter on using RDoc, the Ruby tool for extracting documentation from within Ruby (and included C code) code and building documentation, the authors present one of the most interesting aspects of Ruby, RubyGems.
RubyGems is a framework that makes finding and installing Ruby applications and libraries very easy. RubyGems are a standardized way of packaging applications so that users can easily find, install and if needed uninstall Ruby packages. With sections on installing RubyGems, how to find and install the Gems themselves and also Gem libraries. The remainder of this chapter covers creating Gems yourself, with information on how to configure, build and maintain your own Gem.
The final chapters before the Ruby reference part of the book begins, cover a variety of specialized topics including Ruby and the Web, adding GUIs to Ruby using Ruby Tk, how to handle Microsoft Windows automation using Ruby and Ruby extensions and creating Ruby objects using C.
These last two parts of the book are excellent references for a Ruby developer to use when he/she gets stuck on a particular aspect of Ruby development and needs an easy to use, yet complete reference to the language and how things hook together in Ruby. You'll find yourself using this part of the book for sometime.
If you find a need to learn Ruby either for a new project or maybe you've been give some Ruby code to maintain, then this book should help get you started and affective with Ruby. It also contains such a good, concise reference section that you'll find it useful in the long run, unlike many tutorial guides.
You can obtain this book, both printed and softcopy here.
© 2009 Novell, Inc. All Rights Reserved.