New Book: The Ruby Programming Language

| 13 Comments

I am pleased to announced that I'm nearing completion of The Ruby Programming Language, an updated and expanded version of Matz's Ruby in a Nutshell. It will be published by O'Reilly in early 2008 and is available for pre-order now at Amazon.com

Here's how I describe the book in the preface:

This book is an updated version of Matz's book Ruby in a Nutshell which has been expanded well beyond O'Reilly's Nutshell format. As its new title implies, this book covers the Ruby programming language and aspires to do so comprehensively while still being accessible to any experienced programmer who takes the time to read it carefully. This first edition of the book covers Ruby 1.8 and Ruby 1.9.

Ruby blurs the distinction between language and platform, and so the coverage of the language includes a detailed overview of the core Ruby API. But this book is not an API reference and does not attempt to document every class and every method of the core library. Also, this is not a book about Ruby frameworks (like Rails) nor a book about Ruby tools (like rake and gem). This book does not attempt to teach OO programming, or any kind of programming methodology. And although this book documents Ruby authoritatively, it is not intended as a specification for the language: language implementers will need more than this book to correctly implement Ruby.

If you're going to be at RubyConf this weekend, my editor from O'Reilly will have drafts of the book that you can take a look at. If you're not going to be there, you can't see the book itself, but you can browse the table of contents to get an idea of the breadth and depth of the language coverage. (This TOC includes a relatively short table of examples. The book actually contains quite a bit of example code, but most of the examples are unnumbered and don't appear in the TOC.)

I've been working on this book for about a year now and am very excited about it. My hope is that it will be for Ruby what JavaScript: The Definitive Guide is for JavaScript!

13 Comments

Looks tempting. I've never seen a "the x Programming Language" book from O'Reilly before. Where would you say it falls among "Programming Ruby" and "The Ruby Way" (assuming you're familiar with both)? Is this book a hybrid of Nutshell and Examples in a Nutshell type books?

[For the record, I love your Javascript DG, and have 2 5th editions and 1 3rd. You can be pretty certain I'll pick this up.]

I am really looking forward to this book, based on my experience of your JavaScript work.

Edward and Joseph: thanks for your kind words.

Edward: My book is pretty different from both _The Ruby Way_ and _Programming Ruby_.

_The Ruby Way_ is a task-oriented cookbook-style book. It assumes that you already know the language and focuses primarily on the API. My book has one long (very long) chapter about the API that contains a number of task-oriented examples like those in The Ruby Way. But the primary focus of my book is on learning and mastering the language.

_Programming Ruby_, "The Pickaxe" is kind of a complete guide to Ruby. It covers the language, and is an API reference, and covers real-world topics in Ruby development, such as testing, debugging, writing rdoc comments, packaging gems, integrating with Windows, writing C extensions, etc. Since the Pickaxe covers so many topics, it can't cover any in real depth.

My book will be about half the size of the Pickaxe, and it is really focused on the language itself and the most important classes (like Array, Hash, Enumerable, File, and Thread) of the core library. (Instead of including an API reference, I defer to the ri documentation.)

It is this focus on the language the differentiates my book. I cover Ruby with the same rigor that I did for JavaScript in my JS Definitive Guide. This is something that no other book I know of--not even the Pickaxe--has done.

Hey David,

I am looking forward for your book. Since, I saw you active on ruby-core, I have been expecting this sweet surprise. I hope, you intend to cover Ruby Object/Class System in depth.

If possible, please include concurrency support that is coming with 1.9(fibers, native threads, and how to make threads work in C extensions and let them run parallely).

I would love some stuff on rubinius too(there I go with my big mouth.:)

Hemant:

My book does cover classes and objects in depth.

I have a number of examples using threads, mutexes, condition variables, etc., and I do mention fibers.

This is a book about the Ruby language (and the parts of the core API necessary to understand the language). I do not talk about C extensions at all. In part that is because the book is intended to independent of the underlying implementation of Ruby. JRuby users should be able to get as much from this book as MRI users. So, while I mention Rubinius as one possible implementation, there is no information in the book that is specific to that implementation.

Well, thanks for the opportunity that you give to all the people with your book, i would like to know if your book will be available on safari (from oreily), i think i will buy the printed version also because i really need it ;)

Hi David,

Thanks for the good news. I have been practicing Ruby for an year now. I have read most of the available Ruby books. Though they are all excellent books, they lack the depth to take me further in my learning. At this stage I need more depth in some areas like metaprogramming. I couldn't find many resources on these areas apart from whytheluckystiff's metaprogramming article. Are you going to cover these areas in depth in your book? That would be really wonderful.

I think I will get this one. I have been "curious" about Ruby but didn't really like the Pickaxe format. It is on my "wish list".

Hiya David -- congratulations on the new book!

I've been building with Ruby/Rails for some time now and have whistfully wished for a better API browser than RDoc.

Any chance something like jude (rude?) is in the works?

Let me know if you end up in Cambridge -- there's always time to fit in a beer and reminisce about tomatoes on pika's lawn.

Del: as far as I know the book will be available on Safari.

Subbu: the book has a chapter on metaprogramming. Take a look at the table of contents linked from the original post if you want to get an idea of what is in that chapter.

Robert: Amazon.com offers a slight additional discount for pre-orders. :-)

Hey Sanj!

Thanks for writing. I've been tempted to try to improve the user experience with rdoc, and have had to try to keep myself focused on writing the book. But since my book does not include a reference section, I do have to explicitly refer readers to the online docs. If those docs were easier to use I could do so more happily.

I don't think it would be too hard to do something better with rdoc output, and I'm tempted to work on it myself, but I'm not sure it will happen.

I wish I got back to Cambridge more often. I'll look you up if I do.

David

Good work! I look forward to reviewing it for RubyInside at some point.

Sounds like basically a significantly more in-depth and wider gamut book (but in a similar style) to mine (Beginning Ruby). As such, I might have to try and milk the sales out before they crash early next year ;-)

Nice David, I'm looking forward to reading it. I almost picked it when I got a choice of a free book from O'Reilly but decided to wait until it's actually published :)

Books

Comprehensive coverage of Ruby 1.8 and 1.9

"The New Most Important Ruby Book"
Peter Cooper,
rubyinside.com

Completely updated for Ajax and Web 2.0

"A must-have reference"
Brendan Eich,
creator of JavaScript

The classic Java quick-reference

Advertising

Pages

Hosted By

Powered by Movable Type 4.21-en