The Ruby Programming Language

By David Flanagan, Yukihiro Matsumoto
January 2008
Pages: 446
ISBN 10: 0-596-51617-7 | ISBN 13: 9780596516178
Press Release
starstarstarstarstar (5) (Average of 5 Customer Reviews)

Buy 2 Get 1 Free Free ShippingGuarantee

Book description

Bestselling author David Flanagan teams up with Ruby creator Yukihiro "Matz" Matsumoto and writer/cartoonist/programmer why the lucky stiff to bring you the authoritative guide to Ruby. Covering versions 1.9 and 1.8, this book helps you learn Ruby's lexical structure, primary expressions, conditionals, syntax, classes, the data it manipulates, and more. For experienced programmers who want to look at this language in depth, this guide is invaluable.
Full Description

The Ruby Programming Language is the authoritative guide to Ruby and provides comprehensive coverage of versions 1.8 and 1.9 of the language. It was written (and illustrated!) by an all-star team:
  • David Flanagan, bestselling author of programming language "bibles" (including JavaScript: The Definitive Guide and Java in a Nutshell) and committer to the Ruby Subversion repository.


  • Yukihiro "Matz" Matsumoto, creator, designer and lead developer of Ruby and author of Ruby in a Nutshell, which has been expanded and revised to become this book.


  • why the lucky stiff, artist and Ruby programmer extraordinaire.
This book begins with a quick-start tutorial to the language, and then explains the language in detail from the bottom up: from lexical and syntactic structure to datatypes to expressions and statements and on through methods, blocks, lambdas, closures, classes and modules.

The book also includes a long and thorough introduction to the rich API of the Ruby platform, demonstrating -- with heavily-commented example code -- Ruby's facilities for text processing, numeric manipulation, collections, input/output, networking, and concurrency. An entire chapter is devoted to Ruby's metaprogramming capabilities.

The Ruby Programming Language documents the Ruby language definitively but without the formality of a language specification. It is written for experienced programmers who are new to Ruby, and for current Ruby programmers who want to challenge their understanding and increase their mastery of the language.

Post-purchase benefits:

Register your book | Submit Errata | Examples


Browse within this book

| Table of Contents | Index | Sample Chapter | Colophon

Book details

First Edition: January 2008
ISBN: 0-596-51617-7
Pages: 446
Average Customer Reviews: starstarstarstarstar (5) (Based on 5 Reviews)


Featured customer reviews

Write a Review


A Fine Piece Of Technical Writing,  April 03 2009
Rating: StarStarStarStarStar
Submitted by Andrew Garber   [Respond | View]

Regardless of whether you're a fan of Ruby, The Ruby Programming Language is one of the finest pieces of technical writing that I have ever laid eyes on. The book is extremely well organized, and details every nook and cranny of the language.


Matz Gets It Right!,  October 06 2008
Rating: StarStarStarStarStar
Submitted by Dave Walz-Burkett   [Respond | View]

This book does for Ruby what Kernighan & Ritchie's "The C Programming Language" did for C. It provides a concise, accessible introduction to the Ruby programming language.

Starting out with a tour of Ruby, you are then taken on a deeper dive into chapters on "Structure and Execution", "Datatypes and Objects", "Expressions and Operators", and "Statements and Control Structures". Some of the real power of Ruby is revealed in chapters on "Methods, Procs, Lambdas, and Closures", "Classes and Modules", and "Reflection and Metaprogramming".

The book closes with chapters on "The Ruby Platform" and "The Ruby Environment". The chapter on the Ruby Platform is like a condensed API guide to Ruby's core library. The chapter on the Ruby Environment will help you navigate through the Ruby interpreter's command-line arguments and environment variables as well as a grab-bag of extra Ruby topics that were not covered earlier in the book.

The book is well organized and easy to read. Each chapter is peppered with code samples. If you are serious about learning Ruby, get this book! It sits on my bookshelf, next to a copy of the Pickaxe book and The Ruby Way. Bonus: each chapter of the book starts with a work of art by why the lucky stiff!


re: Horrible font issue in the PDF Version,  March 25 2008
Submitted by Anonymous Reader   [Respond | View]

Keith, thanks for fixing this issue.

P.S. you seem to have a small typo in the last sentence of your O'Reilly bio:

Additionally, Keith is helps run the Bay Area Functional Programmers


Read all reviews


Keith Fahlgren photo re: Horrible font issue in the PDF Version,  March 25 2008
Submitted by Keith Fahlgren | O'Reilly AuthorO'Reilly Blogger   [Respond | View]

Based on reader complaints, we've gone back to the font foundry and gotten an OTF version of the problematic constant-width fonts. A new PDF that resolves the Preview-rendering issues has been released and all customers that had previously purchased this PDF should have been notified via email.


re: Horrible font issue in the PDF Version,  March 24 2008
Submitted by Anonymous Reader   [Respond | View]

Allen, do you have anything to update on this issue? My bug against Preview is: rdar://problem/5815379

Thanks.


re: Horrible font issue in the PDF Version,  March 21 2008
Rating: StarStarStarStarStar
Submitted by boo   [Respond | View]

What has changed in the pdfs recently? I have the same problem with the Shortcuts edition on PyParsing which I bought today, but don't have the problem with the pdf of the Ruby Cookbook, which I bought around the time of its release in mid-2006, nor any of the other pdfs I have bought from O'Reilly (Rails Cookbook, Designing Web Navigation, etc...).






A Must-Have For Serious Ruby Developers,  March 04 2008
Rating: StarStarStarStarStar
Submitted by Larry   [Respond | View]

Like the book says in the beginning: "Ruby is not a simple language... and this book is not a simple book. It is intended for experienced programmers... and are willing to read carefully and thoughtfully to achieve this goal."
Ruby is still relatively new, so there are not a ton of books from which to choose. But you gotta figure that one by the creator of the language (Y. Matsumoto) and the author of the popular "Java in a Nutshell" (D. Flanagan) is bound to be good - and it is.
It's a simple, no-nonsense text that will answer just about any question you might have about the Ruby programming language. This and the more-conversational-in-tone "The Ruby Way" by Hal Fulton make for an unbeatable pair.


re: Horrible font issue in the PDF Version,  March 01 2008
Submitted by Anonymous Reader   [Respond | View]

Allen,

Thanks for your commitment to this important issue. Those links were certainly interesting.

After reading them all, I promptly cleared every known Mac OS X font cache and rebooted. As almost all users from the various links had reported some level of resolution with this same procedure, I was hopeful. Alas, it was not to be, and upon reboot Preview was still unwilling to render TheSans Mono Condensed properly.

Knowing absolutely nothing about PDF creation but unwilling to accept this subpar fate for an otherwise exceptional work, I downloaded Acrobat Professional 8 Trial from Adobe.

One short hour later it was installed and ten minutes after that, The Ruby Programming Language PDF was rendering perfectly in Preview on Mac OS X.

Great news and it was a simple fix. I just exported the PDF as a PostScript "Level 2" file, including "Embedded and Referenced fonts" and then simply regenerated the PDF from the exported PS with Acrobat Distiller.

Again, pardon my ignorance of the document creation process in general. Here's a link to the screenshot showing both your original and the regenerated version rendered side-by-side:

http://socialface.com/failure/image/82798

If we could get a little closer to what the problem is, it would certainly be easier to file a bug against Preview...

Your level of dedication truly is what separates O'Reilly from the competition, thanks again.




Allen Noren photo re: Horrible font issue in the PDF Version,  February 29 2008
Submitted by Allen Noren | O'Reilly AuthorO'Reilly Blogger   [Respond | View]

I sent your latest reply to Keith Fahlgren in our production/tools group. He corrected me regarding my use of "standards" and provided some documentation. Regarding my standards comment, Keith wrote:

"Not "web standards", but "Type1 font embedding in the PDF standard."

In regards to your offer of sending some notification to Apple, Keith wrote:

"Well, that hasn't done anything in the past. I'm tired of this problem, so here's a very cursory review of Preview font embedding problems via Google:

http://discussions.apple.com/thread.jspa?messageID=6458458
http://lists.apple.com/archives/quartz-dev/2007/Oct/msg00022.html
http://discussions.apple.com/thread.jspa?messageID=6523267

Here's my current fave:

http://nmg.livejournal.com/128612.html




re: Horrible font issue in the PDF Version,  February 29 2008
Submitted by Anonymous Reader   [Respond | View]

Hi Allen,

Thanks for the response and thanks for working hard to make this single PDF work with Preview like every single other publisher has managed to do for every single other PDF I have.

I think it's unfortunate you failed at this mission, though, honestly. The book itself is could easily become the seminal Ruby book (replacing the PickAxe??) and it seems a cruel injustice to see it marred on the Mac this way, where Ruby itself has found such a strong community.

_why's contributions alone merit an extra effort at compatibility from all of us, so what I'd like to do is ask you which specific standard Apple isn't supporting that would cause this one font to render incorrectly?

In return for you help, I'll personally file a bug with Apple as well as pass this around to some people and see if we can't get some attention on the issue.

Thanks again, Allen.


Allen Noren photo Re: Horrible font issue in the PDF Version,  February 29 2008
Submitted by Allen Noren | O'Reilly AuthorO'Reilly Blogger   [Respond | View]

Hello Anonymous,

We worked hard to make our PDFs work with Preview, but since Apple does not support PDF standards, it was a no-win situation for us and, as you note, we list Acrobat as the preferred reader.

Thanks for taking the time to write to us.

--Allen


Horrible font issue in the PDF Version,  February 29 2008
Rating: StarStarStarStarStar
Submitted by Anonymous Reader   [Respond | View]

Trying to read the PDF with Preview on Mac OS X is almost impossible. In particular, the code examples come out severely messed up bold.

It's incredibly distracting and unfortunately, as O'Reilly does suggest, viewing the PDF with Adobe Reader works fine.

SO yes, before you buy this as a PDF, understand you're going to need to view with Adobe Reader...............


Media reviews
"The book covers Ruby 1.8 and 1.9 and with its esteemed authors and technical approach, is sure to become a new 'Bible' for Ruby developers. In programming book style, I’m going to refer to it as the 'Hummingbird' book in future, due to the woodcut pictures of hummingbirds on the front...The Hummingbird deserves to be on your bookshelf, whether you’re a seasoned developer looking to learn Ruby, or an existing Ruby developer who just wants a great core-language reference."
-- Peter Cooper, Ruby Inside


"...a simple, no-nonsense text that will answer just about any question you might have about the Ruby programming language."
-- Larry Hannay, Amazon.com


"One long-time Rails developer sent me an email with their first impressions of The Ruby Programming Language: "I have been finding the book very useful, and I'm glad I did get it sooner rather than later." Matz said "Ruby is designed to make programmers happy." It looks like similar design thinking went into this book."
-- Brian DeLacey, Slashdot.org


"For a long time now Dave Thomas’ Programming Ruby (aka. The Pickaxe) has been the standard in the Ruby community as the book to learn Ruby from. Unfortunately the Pickaxe is not the best programming book ever written. In fact, its bulk and slowness almost killed my inspiration to learn Ruby. I respect Dave Thomas a lot for what he does for the Ruby community but the Pickaxe and I just did not click. Since I didn’t find the Pickaxe to be excellent reading material, I had been eagerly anticipating David Flanagan’s The Ruby Programming Language to come out and unseat The Pickaxe as the de facto book to recommend to newcomers to Ruby. I am happy to say that The Ruby Programming Language did not disappoint. I picked up this book solely expecting to just review it since I already comfortable programming in Ruby. However, once I started reading the book I found myself frequently learning things about Ruby that I didn’t know before. Not like little things either like, “oh that’s interesting”. I’m talking significant things like “holy crap that’s sweet!”...O’Reilly is hoping that The Ruby Programming Language becomes the equivalent of K&R’s The C Programming Language for Ruby and I hope it succeeds. I think that every language needs their own K&R book for people to turn to as the definitive authority." "
-- Rob Olson, Thinking Digitally


"Ruby aficionados have been working for the last few years under a serious handicapt: there was not good, up-to-date reference on their favorite language. Sure, the Pickaxe book provided some guidance, but it's a hybrid work--part tutorial, part reference. And the reference section was a summary, rather than an in-depth exposition. Ever-dependable O'Reilly just released Ruby Programming Language, which is without a doubt the definitive Ruby reference. Not only is it co-authored by Yukihiro "Matz" Matsumoto, the inventor of Ruby, but it is superbly well edited, so that every page is full of useful information presented clearly. And at more than 400 pages, that's a lot of information. Couple this book with The Ruby Cookbook, which I reviewed on this blog, and you have probably the best 1-2 combination for learning and using Ruby. "
-- Andrew Binstock, Binstock on Software


"Really found this to be an excellent guide to the Ruby programming language. This is definitely not just the API rehashed in print...The writing style is like having an expert sit down and explain to you the various facets of the language, how to use them, points that are notable, etc. And all of this content is within a reasonable 400 pages."
-- Justin Pease, Amazon.com


"The Ruby Programming Language is my new favorite Ruby book. I personally think it is a better text than the famous "Pickaxe" book...If you want the defacto Ruby book, this is it."
-- B. Donovan, Amazon.com


"The Ruby Programming Language is one of the only books on the list to receive a perfect 5/5 stars from Amazon. The O'Reilly resource on Ruby is an excellent guide for those wanting to learn the language from the bottom-up. The text is centered largely around theory and thoroughly explains the API and syntax around the language."
-- Glen Stansberry, NETTUTS


"An absolute steal at the price; if you've any interest in Ruby you have to buy this book. "
-- Andy Hudson, Linux Format

Hide extended reviews


See larger cover

"...with its esteemed authors and technical approach, is sure to become a new 'Bible' for Ruby developers."
--Peter Cooper, Ruby Inside