Programming Ruby: The Pragmatic Programmers' Guide (Pragmatic Programmers Series) / Edition 2by Dave Thomas, Chad Fowler, Andy Hunt
Pub. Date: 10/28/2004
Publisher: Pragmatic Programmers, LLC, The
Ruby is an increasingly popular, fully object-oriented dynamic programming language, hailed by many practitioners as the finest and most useful language available today. When Ruby first burst onto the scene in the Western world, the Pragmatic Programmers were there with the definitive reference manual, Programming Ruby: The Pragmatic Programmer's… See more details below
Ruby is an increasingly popular, fully object-oriented dynamic programming language, hailed by many practitioners as the finest and most useful language available today. When Ruby first burst onto the scene in the Western world, the Pragmatic Programmers were there with the definitive reference manual, Programming Ruby: The Pragmatic Programmer's Guide.
Now in its second edition, author Dave Thomas has expanded the famous Pickaxe book with over 200 pages of new content, covering all the improved language features of Ruby 1.8 and standard library modules. The Pickaxe contains four major sections:
- An acclaimed tutorial on using Ruby.
- The definitive reference to the language.
- Complete documentation on all built-in classes, modules, and methods
- Complete descriptions of all 98 standard libraries.
If you enjoyed the First Edition, you'll appreciate the expanded content, including enhanced coverage of installation, packaging, documenting Ruby source code, threading and synchronization, and enhancing Ruby's capabilities using C-language extensions. Programming for the World Wide Web is easy in Ruby, with new chapters on XML/RPC, SOAP, distributed Ruby, templating systems, and other web services. There's even a new chapter on unit testing.
This is the definitive reference manual for Ruby, including a description of all the standard library modules, a complete reference to all built-in classes and modules (including more than 250 significant changes since the First Edition). Coverage of other features has grown tremendously, including details on how to harness the sophisticated capabilities of irb, so you can dynamically examine and experiment with your running code. "Ruby is a wonderfully powerful and useful language, and whenever I'm working with it this book is at my side" Martin Fowler, Chief Scientist, ThoughtWorks
Table of Contents
|3||Classes, objects, and variables||25|
|4||Containers, blocks, and iterators||43|
|6||More about methods||79|
|8||Exceptions, catch, and throw||107|
|10||Basic input and output||127|
|11||Threads and processes||135|
|13||When trouble strikes||163|
|14||Ruby and its world||177|
|15||Interactive Ruby shell||185|
|17||Package management with Ruby gems||215|
|18||Ruby and the Web||235|
|20||Ruby and Microsoft Windows||267|
|22||The Ruby language||317|
|24||Classes and objects||379|
|25||Locking Ruby in the safe||397|
|26||Reflection, ObjectSpace, and distributed Ruby||403|
|27||Built-in classes and modules||423|
and post it to your social network
Most Helpful Customer Reviews
See all customer reviews >
I found this book to be very well written and concise, though clearly intended for someone with some level of prior programming experience. My only real complaint is that some of the chapters, while covering a wide amount of material, seem to be lacking in depth. Aside from that, however, I found this book to be more than adequate to give a solid a foundation in Ruby, and after it serves as an extremely useful reference for the classes and modules that are built-in to Ruby. All in all, if you're interested in learning Ruby, this book should definitely be in your collection.
When Dave Thomas and Andy Hunt, authors of The Pragmatic Programmer, published the first edition of Programming Ruby in 2000, it was the first English language Ruby book. Ruby documentation was so scant that they had to study the source code to do it, as Ruby's author, Matz, explains in his foreword. For 2005, they revised it to cover Ruby 1.8, the latest major release. Though there are now several other Ruby books, Programming Ruby is still trying to do it all -- language tutorial, language reference, a guide to thinking in Ruby (which includes thinking in objects), and an introduction to the Ruby community's conventions. The book is broader than it is deep, but, given its breadth, that's praising with faint damns. It's not a book for a programming novice, but the language tutorial was thorough and clear. Moderately experienced programmers should have no problems with it. If you've done object-oriented and functional programming before, it'll be easy going. I was impressed by how much the book includes of what you need to actually _develop_ in Ruby -- trying code snippets in the interactive Ruby shell, debugging, watching out for Ruby's gotchas, developing a test suite, documenting (in Rdoc, a Ruby standard), packaging code into a Ruby Gem (RubyGems is Ruby's equivalent to Perl's CPAN), profiling your code to find the slow parts, and how to extend Ruby in C to speed them up. There's a brief survey of using Ruby for Web, Tk, and Win32 programming. The book's emphasis on breadth over depth is most obvious here -- 18 pages on web programming doesn't just cover CGI programming, but touches on cookies, session maintenance, two template systems for HTML generation, eruby (a means of embedding Ruby in HTML, like PHP, Mason, PSP, or the other *SPs), SOAP, WSDL, and the Google API. (Ruby on Rails is mentioned only as a framework 'currently attracting mindshare in the Ruby community.') For all their brevity, these chapters were still useful. They're a starting point for learning available tools for those problem domains. More importantly, they demonstrate the breadth of the standard library and other available packages, and provide a lesson in looking for existing solutions first. That's old hat to people used to the open source world, but it could prove invaluable to someone who wandered in from the outside. Almost half the book is a reference to the built-in classes and modules, and to the standard library. Ruby has dozens of built-in classes, each, typically, with dozens of methods, so it's no surprise that a lot of this information went unmentioned in the language tutorial. In my use of the reference so far, I've found it clear and well-organized. Perl played a part in inspiring Ruby. Likewise, it strikes me that Programming Ruby's authors probably took inspiration from Programming Perl. It's even nicknamed for its cover illustration -- the PickAxe Book. And, like the Camel Book, it goes beyond the language at hand to advance general principles of good programming: code reuse, writing for maintainability, and avoiding reinventing the wheel. And it's all written with an infectious joy in programming. My only complaint about the book is that the index is spotty in its coverage of the language tutorial chapters -- I've felt frustrated trying to find discussions of things because, too often, the index only pointed to the reference section's coverage of them. But the book left me excited about programming in Ruby, and gave me all I needed to begin. That's all I could ask from an introduction to a new language.
Overall, I like this book. If you are new to Ruby, I would recommend it. The book takes you through a process (like a long tutorial). The last part of the book is strictly reference material. The bad thing is that if you are new to OOP and new to Ruby, you might find it leaves out too many details or just doesn't quite cover them in the depth you might require. I like the book. But, I think I'll have to continue to use Google to supplement it. The previous review critcized the Ruby language. In response to it, I will say that Ruby is the epitomy of OOP (though maybe not quite as much as SmallTalk). I haven't used Java or Perl. So, I'm not qualified to compare those. But, so far, Ruby seems to make alot of sense to me.
Yet another scripting language. Originating in Japan, its inventor (Y Matsumoto) claims that it is more powerful than Perl and more object oriented than Python. Somehow, I imagine proponents of those languages might vociferously disagree. In any event, Thomas does a nice job of documenting Ruby, for the benefit of a newcomer. A key strength of Ruby seems to be what it calls containers, blocks and iterators. This includes a nice ability to have hash tables. Certainly, you have more to start with than in a bare bones language like C. Veterans of Java will recognise and appreciate this native Ruby functionality. The importance of these functions can be seen in the unusual order in which they appear in the book. Thomas discusses these in a chapter that precedes talking about mundane and simpler things like the standard variable types, operators and loops. Most texts of any language would reverse the order. Overall, I am ambivalent about Ruby. Not so much because I disagree with what Thomas says, as simply because I'm quite comfortable in Java. Nonetheless, if you are casting around for a strong OO scripting language, Ruby might be worth consideration.