Ruby by Example and over one million other books are available for Amazon Kindle. Learn more
Flip to back Flip to front
Listen Playing... Paused   You're listening to a sample of the Audible audio edition.
Learn more
See this image
Have one to sell? Sell on Amazon

Ruby by Example: Concepts and Code Paperback – June 8, 2007

ISBN-13: 978-1593271480 ISBN-10: 1593271484 Edition: 1st
Buy used
Buy new
Used & new from other sellers Delivery options vary per offer
67 used & new from $6.54
Amazon Price New from Used from
"Please retry"
Paperback, June 8, 2007
"Please retry"
$10.00 $6.54

Hero Quick Promo
Save up to 90% on Textbooks
Rent textbooks, buy textbooks, or get up to 80% back when you sell us your books. Shop Now
$28.94 FREE Shipping on orders over $35. Usually ships within 10 to 13 days. Ships from and sold by Gift-wrap available.

Frequently Bought Together

Ruby by Example: Concepts and Code + Wicked Cool Ruby Scripts: Useful Scripts that Solve Difficult Problems + Everyday Scripting with Ruby: For Teams, Testers, and You
Price for all three: $74.05

Some of these items ship sooner than the others.

Buy the selected items together

Editorial Reviews

About the Author

Kevin C. Baird received his Ph.D. from the State University of New York at Buffalo. He originally wrote his dissertation in Python but rewrote the project after discovering Ruby, and he hasn't looked back since. He has presented at RubyConf and written articles for Linux Journal, Music & Computers magazine, and the New Interfaces for Musical Expression conference proceedings.


Shop the new
New! Introducing the, a hub for Software Developers and Architects, Networking Administrators, TPMs, and other technology professionals to find highly-rated and highly-relevant career resources. Shop books on programming and big data, or read this week's blog posts by authors and thought-leaders in the tech industry. > Shop now

Product Details

  • Paperback: 326 pages
  • Publisher: No Starch Press; 1 edition (June 8, 2007)
  • Language: English
  • ISBN-10: 1593271484
  • ISBN-13: 978-1593271480
  • Product Dimensions: 7 x 0.8 x 9.2 inches
  • Shipping Weight: 1.3 pounds (View shipping rates and policies)
  • Average Customer Review: 4.1 out of 5 stars  See all reviews (14 customer reviews)
  • Amazon Best Sellers Rank: #1,056,181 in Books (See Top 100 in Books)

More About the Author

Discover books, learn about writers, read author blogs, and more.

Customer Reviews

4.1 out of 5 stars
Share your thoughts with other customers

Most Helpful Customer Reviews

11 of 11 people found the following review helpful By Thing with a hook on January 26, 2008
Format: Paperback
Ruby By Example seeks to teach Ruby by introducing a series of small scripts, explaining how they work, often by showing some examples in irb, Ruby's interactive shell, and reinforcing the explanations with some suggested modifications to the script to highlight the principles just expounded. The closest examples in other languages I'm aware of are Dive Into Python and (to a lesser extent) Wicked Cool Perl Scripts.

This is a very nice idea, and there are some examples that are a cut above the usual fare: chapter 9 includes a Bible Code generator, and an implementation of the 'methinks it is like a weasel' sentence natural selection program from Richard Dawkins' The Blind Watchmaker. There's also mention of memoization, profiling and benchmarking, the Schwartzian transform for sorting, and even Symbol#to_proc. There's also quite a gentle introduction to Rails, which is probably sufficient for someone new to Ruby and Rails to move onto Ruby for Rails.

However, the execution isn't always perfect. Probably the biggest downside to this pedagogical approach is that there's not really one obvious place to describe how a particular feature works in depth, or the focus moves away from its practical use in a script. As a result, many of the explanations are compressed. Chapter 1 provides a 'crash' description of object orientation in 9 lines.
Read more ›
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
14 of 15 people found the following review helpful By Scott Schram on August 26, 2007
Format: Paperback
"Ruby by Example, Concepts and Code" teaches the Ruby language through immersion in examples.

The book begins with a brief introduction to Ruby and the interactive Ruby shell (which allows typing in Ruby code and immediately seeing the results).

The 45 examples that follow are carefully crafted to introduce new language features. A typical example includes these sections:

* The Code
* How It Works
* Running the Script
* The Results
* Hacking the Script

The reader is tempted to open up the examples in an editor, run them and tinker with them.

There is a focus on programming paradigms (or styles). The three main types covered are: imperative, object-oriented and functional. The imperative style "tells computers: Do this, then do that, then do this next thing." "Object-oriented languages define objects (types of things) that know how to perform methods." "Functional languages treat programming problems like mathematical relationships" and allow handling of functions and blocks of codes as if they were objects themselves. Ruby has strengths in all three of these areas, but this book offers more coverage of the functional paradigm than you might see elsewhere.

The examples advance in scope and complexity and cover practical topics like HTML and XML handling, CGI programming (which is a simple technique to make programmable web pages) and finally a sample Ruby on Rails web application.

An appendix compares and contrasts Ruby to several other languages (C, Haskell, Java, Lisp, Perl, PHP, Python and Smalltalk). For each language, the author gives some history, the particular focus or strengths of that language, and how Ruby was inspired by or shares some of the best features of each.
Read more ›
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
9 of 10 people found the following review helpful By Michael Ivancic on July 19, 2007
Format: Paperback
This book has really helped me dive-in, start using, and more importantly start understanding Ruby. About a year before this book came out I read the Ruby Pick Axe but didn't feel like I had a great understanding and command of the language (I was also new to object oriented languages). I needed real life examples and actual code that illustrated Ruby concepts and showed them in action. That's exactly what I got with this book.

I think this book would be an excellent choice for someone wanting to learn Ruby, regardless of your level of programming experience. I'm self-taught with entry level programming skills and I had no problem understanding the concepts and examples in this book. The book even explains the basics like variables, objects, and methods and doesn't assume you know anything about object oriented languages, programming, or Ruby. The example scripts are pretty neat and very useful too. I've already started customizing my own version of the sample Rails photo album for my wedding pictures too. (Thanks Kevin!)

Whether you're looking to learn how to program or looking to learn a new language, I would highly recommend this book! I plan on keeping it in my programming book collection!
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
4 of 4 people found the following review helpful By Ricardo Dapaz on February 11, 2008
Format: Paperback
If you want to learn Ruby quickly and you can only afford to buy one book to do it with, this is the one I would buy! It has interesting little projects with well documented code which introduces you gradually to more advanced topics in the language. It is not a cookbook, but rather, a very well picked selection of programmes where new concepts are thoroughly explained and older concepts are reinforced. There are "hacks" to just about every script and I was able to learn more from this than I did from grinding through the Pick Axe. Amazingly, now when I pick up the Pick Axe it seems accessible!

Well worth the investment!
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again

Most Recent Customer Reviews