Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×

Programming Ruby 169

While Ruby isn't new, it's one scripting-and-everything else language which has yet to break out (in the U.S. at least) the way Perl and Python have. Chromatic may help buck that non-trend -- he says that Ruby is one polished gem of a language, and below he introduces a book on Ruby that he compares in importance with the O'Reilly Camel book.

Programming Ruby
author David Thomasand Andrew Hunt
pages 564
publisher Addison-Wesley
rating 9
reviewer chromatic
ISBN 0-201-71089-7
summary A no-nonsense, clear guide that's as clean and usable as Ruby itself.

*

The Scoop

Ruby 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 Summary

This 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

  1. Roadmap
  1. Facets of Ruby
    1. Ruby.New
    2. Classes, Objects, and Variables
    3. Containers, Blocks, and Iterators
    4. Standard Types
    5. More About Methods
    6. Expressions
    7. Exceptions, Catch, and Throw
    8. Modules
    9. Basic Input and Output
    10. Threads and Processes
    11. When Trouble Starts
  2. Ruby in Its Setting
    1. Ruby and Its World
    2. Ruby and the Web
    3. Ruby Tk
    4. Ruby and Microsoft Windows
    5. Extending Ruby
  3. Ruby Crystallized
    1. The Ruby Language
    2. Classes and Objects
    3. Locking Ruby in the Safe
    4. Reflection, ObjectSpace, and Distributed Ruby
  4. Ruby Library Reference
    1. Built-in Classes
    2. Built-in Modules
    3. Standard Library
    4. Object-Oriented Design Libraries
    5. Network and Web Libraries
    6. Microsoft Windows Support
  5. Appendices
    1. Embedded Documentation
    2. Interactive Ruby Shell
    3. Support
    4. Bibliography


Besides reading online, you can purchase this book at ThinkGeek

This discussion has been archived. No new comments can be posted.

Programming Ruby

Comments Filter:

Intel CPUs are not defective, they just act that way. -- Henry Spencer

Working...