Join Amazon Prime and ship Two-Day for free and Overnight for $3.99. Already a member? Sign in.

 

or
Sign in to turn on 1-Click ordering.
 
 
More Buying Choices
39 used & new from $4.99

Have one to sell? Sell yours here
 
   
Ruby by Example: Concepts and Code
 
 
Tell the Publisher!
I’d like to read this book on Kindle

Don’t have a Kindle? Get yours here.
 
  

Ruby by Example: Concepts and Code (Paperback)

by Kevin Baird (Author)
Key Phrases: irb session, true irb, user system total, Hacking the Script, Album Controller, Canadian Dollars (more...)
4.4 out of 5 stars See all reviews (12 customer reviews)

List Price: $29.95
Price: $19.77 & eligible for FREE Super Saver Shipping on orders over $25. Details
You Save: $10.18 (34%)
In Stock.
Ships from and sold by Amazon.com. Gift-wrap available.

Want it delivered Monday, July 13? Choose One-Day Shipping at checkout. Details
29 new from $10.15 10 used from $4.99

Best Value

Buy Learn to Program, Second Edition (The Facets of Ruby Series) and get Ruby by Example: Concepts and Code at an additional 5% off Amazon.com's everyday low price.

Learn to Program, Second Edition (The Facets of Ruby Series) + Ruby by Example: Concepts and Code
Buy Together Today: $35.25

Show availability and shipping details


Customers Who Bought This Item Also Bought

Beginning Ruby: From Novice to Professional (Beginning from Novice to Professional)

Beginning Ruby: From Novice to Professional (Beginning from Novice to Professional)

by Peter Cooper
4.9 out of 5 stars (29)  $32.57
The Ruby Programming Language

The Ruby Programming Language

by David Flanagan
5.0 out of 5 stars (25)  $26.39
Programming Ruby 1.9: The Pragmatic Programmers' Guide (Facets of Ruby)

Programming Ruby 1.9: The Pragmatic Programmers' Guide (Facets of Ruby)

by Dave Thomas
4.4 out of 5 stars (62)  $32.97
Ruby Cookbook (Cookbooks (O'Reilly))

Ruby Cookbook (Cookbooks (O'Reilly))

by Lucas Carlson
4.7 out of 5 stars (30)  $31.49
The Ruby Way, Second Edition: Solutions and Techniques in Ruby Programming (2nd Edition) (Addison-Wesley Professional Ruby Series)

The Ruby Way, Second Edition: Solutions and Techniques in Ruby Programming (2nd Edition) (Addison-Wesley Professional Ruby Series)

by Hal Fulton
4.5 out of 5 stars (21)  $31.49
Explore similar items

Editorial Reviews

Product Description
There may be no better way to learn how to program than by dissecting real, representative examples written in your language of choice. Ruby by Example analyzes a series of Ruby scripts, examining how the code works, explaining the concepts it illustrates, and showing how to modify it to suit your needs. Baird's examples demonstrate key features of the language (such as inheritance, encapsulation, higher-order functions, and recursion), while simultaneously solving difficult problems (such as validating XML, creating a bilingual program, and creating command-line interfaces). Each chapter builds upon the previous, and each key concept is highlighted in the margin to make it easier for you to navigate the book.

You'll learn how to:

  • Use the interactive Ruby shell (irb) to learn key features of the language
  • Extend Ruby using RubyGems, the Ruby package manager
  • Create numerical utilities, as well as utilities that process and analyze HTML/XML
  • Implement purely functional and metaprogramming techniques to save time and effort
  • Optimize, profile, and test your code to make sure that it not only does its job, but does it well
  • Create web applications using Rails

Ruby is the fastest growing programming language today, and for good reason: Its elegant syntax and readable code make for prolific and happy programmers. But it can be difficult to understand and implement without a little help. Ruby by Example shows you how to take advantage of Ruby as you explore Ruby's fundamental concepts in action.

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.


Product Details

  • Paperback: 326 pages
  • Publisher: No Starch Press (June 8, 2007)
  • Language: English
  • ISBN-10: 1593271484
  • ISBN-13: 978-1593271480
  • Product Dimensions: 9.1 x 7 x 1.1 inches
  • Shipping Weight: 1.3 pounds (View shipping rates and policies)
  • Average Customer Review: 4.4 out of 5 stars See all reviews (12 customer reviews)
  • Amazon.com Sales Rank: #242,152 in Books (See Bestsellers in Books)

Inside This Book (learn more)


Books on Related Topics (learn more)
 
 

What Do Customers Ultimately Buy After Viewing This Item?


Tags Customers Associate with This Product

 (What's this?)
Click on a tag to find related items, discussions, and people.
Check the boxes next to the tags you consider relevant or enter your own tags in the field below.
(8)

Your tags: Add your first tag
 
Help others find this product — tag it for Amazon search
No one has tagged this product for Amazon search yet. Why not be the first to suggest a search for which it should appear?

Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more

 

Customer Reviews

12 Reviews
5 star:
 (9)
4 star:
 (1)
3 star:
 (1)
2 star:    (0)
1 star:
 (1)
 
 
 
 
 
Average Customer Review
4.4 out of 5 stars (12 customer reviews)
 
 
 
 
Share your thoughts with other customers:
Most Helpful Customer Reviews

 
9 of 9 people found the following review helpful:
5.0 out of 5 stars Ruby Language Immersion by Examples, August 26, 2007
By Scott Schram (Birmingham, AL USA) - See all my reviews
(REAL NAME)   
"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.

Baird sees Ruby's greatest strengths as "readability, a high level of abstraction (and great ease in extending that abstraction even higher), internal consistency and conceptual elegance."

The book is designed to be accessible to a beginning programmer, but would be challenging (in a good way).

Programmers with experience in another language or with some Ruby experience would strongly benefit from reading "Ruby by Example", even if they have read another tutorial book or started working with Rails applications.
Comment Comment | Permalink | Was this review helpful to you? Yes No (Report this)



 
6 of 6 people found the following review helpful:
3.0 out of 5 stars Tries something a bit different, is mostly successful, January 26, 2008
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. Chapter 3 first mentions hashes, but compares them to functions, and not to arrays. Tail recursion is defined in a 4 line footnote in chapter 7. If you already understand these concepts, you'll be fine, but they won't teach you anything. If you don't, they aren't very helpful. At a couple of points the book also insists that everything in Ruby is an object, but code blocks (among other things) aren't until they're wrapped in Procs. For the more functional-esque techniques advocated in the book, this is a subtle point which could trip up a beginner.

Also, some of the examples are weak. Chapter 4 rushes through regular expressions, using them to compress whitespace, but why not also mention String#squeeze? Chapter 5 uses regexes to deal with XML and it gets the job done, but advice on using a real XML parser might have been more useful in the long term. Chapter 6 contains a truly contrived Buffy the Vampire Slayer-related example.

This isn't a bad introduction to Ruby, and it's a very admirable attempt to do something different, but I wanted to like it more than I did. If you already know some object oriented programming, this could make a good companion to a more tutorial-style book, like The Pickaxe.
Comment Comment | Permalink | Was this review helpful to you? Yes No (Report this)



 
8 of 9 people found the following review helpful:
5.0 out of 5 stars The Perfect Way to Learn Ruby..., July 19, 2007
By Michael Ivancic (Buffalo, NY - USA) - See all my reviews
(REAL NAME)   
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 Comment | Permalink | Was this review helpful to you? Yes No (Report this)


Share your thoughts with other customers: Create your own review
 
 
 
Most Recent Customer Reviews

1.0 out of 5 stars I didn't like it.
I ended up making it like 50 pages through the book and just giving up and buying the O'Reilly Learning Ruby. Read more
Published 8 days ago by John M. Wargo

4.0 out of 5 stars Some minor flaws, but a great book overall
Ruby by Example is a great introduction to the Ruby Language. It is not without some flaws, though. The book has good pacing, but seems at times to jump around or not explain... Read more
Published 5 months ago by Craig Maloney

5.0 out of 5 stars Ruby progrmming language.
The book came very fast in the mail. It was new in quality. I am able to teach myself Ruby from the book.
Published 16 months ago by Dennis Williamson

5.0 out of 5 stars Simply Excellent...
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! Read more
Published 17 months ago by Ricardo Dapaz

5.0 out of 5 stars Wonderful Ruby Learning Book!!
'Ruby by Example: Concepts and Code' is the perfect reference for anyone that wants to learn how to use Ruby, one of the hottest programming languages to come around in some time... Read more
Published 18 months ago by Daniel McKinnon

5.0 out of 5 stars Absolutely Brilliant
Superb introduction to Ruby and important programming idioms that every Rubyist should know. Shows you a small chunk of code, with significant lines numbered, and follows the code... Read more
Published 20 months ago by Eric Armstrong

5.0 out of 5 stars Great book!
The author does a great job of digging into the functional nature of Ruby in a way that I haven't seen in the other books. Read more
Published 21 months ago by Mr. Took

5.0 out of 5 stars An important guide for any using or learning Ruby or Rails
Any programmer who would better understand the basics of Ruby would do well to consider RUBY BY EXAMPLE, a learn-by-doing guide which analyzes a series of Ruby scripts, examining... Read more
Published 23 months ago by Midwest Book Review

5.0 out of 5 stars Good Introduction to Ruby
I found this book to be a very refreshing approach to learning a programming language. The author did a great job of breaking down real world samples. Read more
Published 23 months ago by Scott B. Powers

Only search this product's reviews



Customer Discussions

 Beta (What's this?)
New! See all customer communities, and bookmark your communities to keep track of them.
This product's forum (2 discussions)
  Discussion Replies Latest Post
why #15 on page 72 doesn't use log to solve the problem 3 November 2007
Orthagonal reading? 2 September 2007
See all 2 discussions...  
Start a new discussion
Topic:
First post:
Prompts for sign-in
  [Cancel]


Active discussions in related forums
  Discussion Replies Latest Post
Textbooks for Kindle DX? 33 11 hours ago
C# or Java? 32 4 days ago
Does anyone use Discovering Geometry: An Investigative Approach? 3 11 days ago
   


Product Information from the Amapedia Community

Beta (What's this?)



Look for Similar Items by Category


Bath Wonders from LUSH

LUSH bath bombs
Find bath bombs, bath melts, shower jellies, and more great gifts for yourself (or a friend!) from LUSH Fresh Handmade Cosmetics.

Shop LUSH now

 

Big Savings in Books

Bargain Books
Find great titles at fantastic prices in our Bargain Books Store.
 

Get the Best Value with Reconditioned Power Tools

Shop for reconditioned power tools
When purchasing tools, you want to get the most for your money. Browse a wide selection of factory-reconditioned tools at Amazon.com.

Shop now

 

Best Books

Best of the Month
See our editors' picks and more of the best new books on our Best of the Month page.
 

 

Feedback

If you need help or have a question for Customer Service, contact us.
 Would you like to update product info or give feedback on images?
Is there any other feedback you would like to provide?

Your comments can help make our site better for everyone.


Where's My Stuff?

Shipping & Returns

Need Help?

Your Recent History

  (What's this?)
You have no recently viewed items or searches.

After viewing product detail pages or search results, look here to find an easy way to navigate back to pages you are interested in.

Look to the right column to find helpful suggestions for your shopping session.

Continue shopping: Top Sellers

Conditions of Use | Privacy Notice © 1996-2009, Amazon.com, Inc. or its affiliates