|author||David Thomasand Andrew Hunt|
|summary||A no-nonsense, clear guide that's as clean and usable as Ruby itself.|
The ScoopRuby is a growing language that combines the power and conciseness of Perl with the Smalltalk object model. Though popular in Japan, it hasn't reached its potential in English speaking countries, lacking appropriate documentation. Enter Dave Thomas and Andy Hunt. On the heels of The Pragmatic Programmer, they've produced the Ruby equivalent of Perl's Camel.
What's to Like?Programming Ruby starts with a general language overview. A dozen short and sweet chapters form this tutorial. Readers with no programming background won't feel too out of place, though they will need to be comfortable with terminology explained once and used throughout the rest of the book. Topics range from language basics to multithreading and using the debugger. Rather than starting from syntax rules, the authors introduce concepts as their context dictates. There is some conceptual overlap between chapters, but this approach is preferable to discussing one topic at a time, referring briefly to future chapters.
The next section shows how to connect Ruby to other languages and tools. Besides information on Ruby modules and the command line, chapters include CGI programming, Ruby GUI programming with Tk, and automating Windows. The chapter on embedding Ruby in C is short but comprehensive. Within the 200 pages of these two sections, experienced programmers will have learned enough Ruby to be quite productive.
Section three expands further on the core language. Though covering the same areas as the tutorial, these chapters delve into the gory details. (As gory as Ruby gets, which is to say, surprisingly little spit and bailing wire.) Thomas and Hunt write with the authority of language designers producing a standard reference. Chapter 19, Classes and Objects, particularly stands out. It describes Ruby's simple object model, using a handful of well-chosen examples and clean diagrams to punctuate the point.
The final section takes up nearly half of the book. This library reference lists Ruby's built-in and common classes and objects. Each class has a description, a named parent, and a list of mixins and class and instance methods where appropriate. Modules fare similarly. Most explanations include common usage examples.
Four appendices and an impressive index round things out.
What's to Consider?Ruby itself makes a fine starting language. To get the most benefit from the book, it's handy to have experience with OO programming and a similar scripting language. (Python and Perl hackers will have little trouble, Smalltalk coders will feel right at home, and Java and C++ fans will do well.) Beginning programmers won't have their hands held for very long.
A handful of advanced concepts are mentioned but not explained. This is only a minor gripe -- techniques like runtime code generation are beyond the scope of the average hacker's needs. The flexibility of Ruby's object model and the loose distinction between compile-time and run-time obviate the need for much of this trickery anyhow.
Some might find the class reference section slightly hard on the eyes. The repeated horizontal lines are visually distracting -- indentation would improve readability. On the positive side, the class, library, and module sections are arranged alphabetically, with a tabbed margins to improve navigation.
The SummaryThis attractive tome ought to be on the desk of any serious Ruby programmer -- and Ruby itself deserves consideration as a clean and powerful development language. Aimed at moderately experienced programmers, Programming Ruby is a great introduction and a handy reference. Read it online here!
Table of Contents
- Facets of Ruby
- Classes, Objects, and Variables
- Containers, Blocks, and Iterators
- Standard Types
- More About Methods
- Exceptions, Catch, and Throw
- Basic Input and Output
- Threads and Processes
- When Trouble Starts
- Ruby in Its Setting
- Ruby and Its World
- Ruby and the Web
- Ruby Tk
- Ruby and Microsoft Windows
- Extending Ruby
- Ruby Crystallized
- The Ruby Language
- Classes and Objects
- Locking Ruby in the Safe
- Reflection, ObjectSpace, and Distributed Ruby
- Ruby Library Reference
- Built-in Classes
- Built-in Modules
- Standard Library
- Object-Oriented Design Libraries
- Network and Web Libraries
- Microsoft Windows Support
- Embedded Documentation
- Interactive Ruby Shell
Besides reading online, you can purchase this book at ThinkGeek