Slashdot Mirror


Programming Ruby: The Pragmatic Programmers' Guide

James Edward Gray II writes " Programming Ruby: The Pragmatic Programmers' Guide (Second Edition), known as the Pickaxe II to its fans, is an extremely current view of the Ruby programming language. Revised primarily by Dave Thomas, a founding father of the English Ruby community, Programming Ruby is distilled expertise from a reliable source. In the past, quality English documentation of Ruby has been in short supply, but if any one volume could solve that problem, this is it." Read on for the rest of Gray's review. Programming Ruby: The Pragmatic Programmers' Guide author Dave Thomas with Chad Fowler and Andy Hunt pages 830 publisher Pragmatic Bookshelf rating 9 reviewer James Edward Gray II ISBN 0974514055 summary The definitive source for all things Ruby.

If you're not familiar with it, Ruby is a very fun and elegant scripting language that has been described as "more powerful than Perl and more object oriented than Python." I won't start a language war by defending that statement, but I will tell you what makes Ruby very attractive to me: Extremely object oriented, super clean syntax, and a smooth blending of iterators and code blocks for straightforward, concise solutions. If that sounds like a language you would like to know more about, Programming Ruby is the book for you.

At 830 pages, this edition is considerably larger than the first. It represents an expansion on many topics originally covered, in addition to all new coverage on topics like unit testing, RDoc documentation for Ruby source code, and more. Better still, "Duck Typing," a topic central to Ruby philosophy, receives its own enlightening chapter. This volume covers the very latest release of the language, often highlighting new features and even giving tips for things to watch for in future versions.

Programming Ruby is divided into four distinct sections. "Part I - Facets of Ruby" is a tutorial on the Ruby Programming Language. It's very effective, but I probably better give a warning here: This book teaches you how to program in Ruby, not how to program. You likely won't feel comfortable, even in this tutorial section, unless you have some experience with other programming languages. As an example, Ruby is object oriented on a scale with languages like Smalltalk, so you'll need to know object oriented programming. This book makes no attempt to teach such concepts, excepting how they apply to Ruby. As long as you come with the proper background, this section will get you on your feet with Ruby in under 200 pages. It's very well thought out.

"Part II - Ruby in its Setting" is a mixed-bag tour on the many places Ruby sees use. Web programming, command-line hacking, using TK to build GUIs, and Windows programming are just some of the covered topics. Other chapters in here focus on elements unique to Ruby, like the earlier mentioned RDoc or "irb," the interactive Ruby shell. There's even a chapter in here on package management with RubyGems.

When you're ready, "Part III - Ruby Crystallized" will take you deep into the core of Ruby syntax and functionality. This section tells you all the details about how Ruby reads your code, and how it runs. I think few people could soak in all the tidbits in here in one scan. I've read it twice now and learned about as much both times. There's a lot of great Ruby knowledge waiting to be mined out of here.

Finally, "Part IV - Ruby Library Reference" is the best Ruby reference I've yet run across. It covers every class, module, method and constant in core Ruby. The descriptions for these entities tell you exactly what you need to know, the examples, though short, are inspiring, and the comments sneak in subtle hints that are more than useful. Following this, the book gives an overview of all Standard Libraries included with Ruby. This section really opened my eyes to the tools I've been missing out on simply because I didn't know they were there. Be warned: These Standard Library summaries won't teach you every feature available. They just tell you what they're for so you'll know where to look for the information you need. The last great feature in this section is a terrific index. I care about the index and a book that has a bad one will really bother me. Luckily, that couldn't be further from the truth here.

Programming Ruby isn't perfect, of course. Some of the chapters are not as thorough as you wish they could be, simply because of the amount of information that needs to be covered. The chapter on threads is probably the biggest example of this, but remember that entire volumes have been written on threading. Another minor point is that some of the examples are quite contrived. This bothers some people, but I don't feel it's too much trouble for the book's target audience. As I've said, you're expected to know how to program going into this book, just not how to program in Ruby.

Programming Ruby at least touches on most things central to the Ruby Programming Language, and goes into considerable detail more often than not. There's something for all levels here. You can learn Ruby from the tutorial, as I did with the first edition, but you'll keep coming back to the wonderful reference and to go deeper into specific areas of interest. That's a lot of great mileage for one book. I'm willing to bet most Ruby Gurus keep it in arm's reach, because Ruby wouldn't be half as much fun without it.

You can purchase Programming Ruby from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

4 of 231 comments (clear)

  1. Would you like to probe my body? by (TK11)Dessimat0r · · Score: -1, Troll

    -INSANE-PRIEST--INSANE-PRIEST--INSAN
    I___________,.-------.,____________I Slashdot
    N______,;~'_____________'~;,_______N fucking
    S____,;____LINUX FUCKING____;,_____S sucks
    A___;___SUCKS, YOU FUCKING____;____A
    N__,'____SLASHDOT RETARDS.____',___N Rob Malda
    E_,;___GET IT INTO YOUR HEAD___;,__E is a
    -_;_;______._____l_____.______;_;__- cocksucker
    P_l_;____________l____________;_l__P
    R_l__`/~"_____~"_._"~_____"~\'__l__R Slashdot
    I_l__~__,-~~~^~,_l_,~^~~~-,__~__l__I fucking
    E__l___l________}:{__ (O) _l___l___E sucks
    S__l___l_ (o) _/_l_\_______!___l___S
    T__.~__(__,.--"_.^._"--.,__)__~.___T Rob Malda
    -__l_____---;'_/_l_\_`;---_____l___- is a
    -___\__._______V.^.V___((oo))./____- cocksucker
    I__O_VI_\________________ll_IV___O_I
    N_____I_lT~\___!___!___/~ll_I______N Fucking
    S_____I_l`IIII_I_I_I_IIIIll_I__o___S lameness
    A_O___I__\,III_I_I_I_III,ll_I______A filters,
    N______\___`----------'__ll/____o__N will
    E____O___\___._______.___ll________E this
    -_________\..___^____../(_l___O____- ever
    P_________/_^___^___^_/__ll\_______P fucking
    R_O______/`'-l l_l l-';__ll_l___O__R WORK?!
    I_______;_`'=l l_l l='__/ll_l______I
    E_____O_l___\l l~l l__l/_ll_l______E Your mother
    S_______l\___\ l_l l__;__ll_l__O___S was good
    T__o____l_\___ll=l l==\__ll_l______T in bed, she
    -____o__l_/\_/\l_l l__l`-ll_/______- grunts like
    -_______'-l_`;'l_l l__l__ll_____O__- an ape.
    I_O_______l__l l_l l__l__ll________I
    N____O____l__l+l_l+l__l__ll___O____N Rob Malda
    S_________l__"""_"""__l__ll________S is a
    A__O______l____o_o____l__ll____O___A cocksucker
    N_________l,;,;,;,;,;,l__ll________N
    E_____O___`lIlIlIlIlIl`__ll________E
    -__________llIlIlIlIll___ll_____O__- By Dessimat0r
    P__________`"""""""""`___""________P (c)2003 Trollkore
    -INSANE-PRIEST--INSANE-PRIEST--INSAN

    The bishop, while living, was a follower of God.
    Now dead, his rotting fingers are able to raise
    an army of skeletons from the grave.

    Trollkore
    "I hate you, I hate your country, and I hate your face!"

    # Important Stuff: Please try to keep posts on topic. # Try to reply to other people's comments instead of starting new threads. # Read other people's messages before posting your own to avoid simply duplicating what has already been said. # Use a clear subject that describes what your message is about. # Offtopic, Inflammatory, Inappropriate, Illegal, or Offensive comments might be moderated. (You can read everything, even moderated posts, by adjusting your threshold on the User Preferences Page) # Important Stuff: Please try to keep posts on topic. # Try to reply to other people's comments instead of starting new threads. # Read other people's messages before posting your own to avoid simply duplicating what has already been said. # Use a clear subject that describes what your message is about. # Offtopic, Inflammatory, Inappropriate, Illegal, or Offensive comments might be moderated. (You can read everything, even moderated # Important Stuff: Please try to keep posts on topic. # Try to reply to other people's comments instead of starting new threads. # Read other people's messages before posting your own to avoid simply duplicating what has already been said. # Use a clear subject that describes what your message is about. # Offtopic, Inflammatory, Inappropriate, Illegal, or O

  2. Re:Too many new languages at once... by Doesn't_Comment_Code · · Score: 0, Troll

    Thanks, I just looked at that page, and it has a lot of info. I still can't decide which to use though. The page suggests Python is easier to learn if you like C (which I do), and Ruby makes more sense if you like Perl (which I do also).

    I hope I don't have to learn them both before I can make a decision, but maybe I'll have to.

    --

    Slashdot Syndrome: the sudden, extreme urge to correct someone in order to validate one's self.
  3. Re:It is extremely important to mention Parrot by Doesn't_Comment_Code · · Score: 0, Troll

    Thanks! That's really interesting. I've never heard of Parrot before. I wonder to what lengths the languages will be interoperable. It is a noble goal (and I'm just imagining how great it would be to switch back and forth between languages within a program) but it's also a lofty goal. What about languages that treat data differently? There must be some level beyond which you cannot interleave languages. Lines, or at least functions would have to have uniformity wouldn't they?

    I'm not a nay-sayer. But I am very curious about this project. Perhaps I'll read more about it when I get a chance.

    --

    Slashdot Syndrome: the sudden, extreme urge to correct someone in order to validate one's self.
  4. Re:Learn them both! by Doesn't_Comment_Code · · Score: 0, Troll

    Thanks or the advice. I'm starting to think I might like Ruby a little better than Python. The jury's still out, but I'm leaning that way.

    --

    Slashdot Syndrome: the sudden, extreme urge to correct someone in order to validate one's self.