Ruby by Example: Concepts and Code
 

Related Products













Product Lists

Ruby by Example: Concepts and Code

by No Starch Press

$29.95
buy from amazon.com
Average Rating: * * * * *
Sales Rank:221792 (lower is better)
Price Used:$15.99
Shipping:Free Shipping on most orders over $25*
Availability:Usually ships in 24 hours
Label:No Starch Press
Pages:326
Binding:Paperback
Publication Date:2007-06-08
Published By:No Starch Press
ASIN:1593271484
Category:Book

Authors

Editorial Reviews and Product Descriptions

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.

Customer Reviews

Ruby progrmming language. - Reviewed on 2008-03-09
* * * * *
1 customer found this review not to be helpful.
The book came very fast in the mail. It was new in quality. I am able to teach myself Ruby from the book.
Simply Excellent... - Reviewed on 2008-02-11
* * * * *
3 customers found this review helpful.

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!
Tries something a bit different, is mostly successful - Reviewed on 2008-01-26
* * *
4 customers found this review helpful.

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.
Wonderful Ruby Learning Book!! - Reviewed on 2008-01-11
* * * * *
4 customers found this review helpful, 1 did not.

'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. With over around 300 pages of content spread across 45 examples, this book will give you all the basis you need to go from a non-Ruby user to someone writing good code immediately!! I think that the No Starch line has some of the most unique layouts you will find from any publishing line. Chapters are usually broken up into small manageable chunks that make it easier for the reader to actually learn and dissect the information they are taking in, fonts are clear and concise, and it's just an enjoyable easy read all around. While this may seem low in importance I don't think that's the case at all. Especially for a book where the user base is someone new to a language, environment or tool, I want a book that is easy to learn from, fun to read and makes me actually want to LEARN and look forward to the next chapter(s). If you want to learn Ruby and build on your development skillset, pick up this book and move to the fast lane!!

***** HIGHLY RECOMMENDED
Absolutely Brilliant - Reviewed on 2007-11-06
* * * * *
2 customers found this review helpful, 1 did not.

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 with descriptive paragraphs that show you what the code is doing. In effect, you learn how to read the code as you go through the book, starting with basic material and getting more advanced as you go along. VERY nicely done.
Read More Customer Reviews »
Go To Amazon Product Page

* - See Amazon Product Page for shipping and pricing details.


Book Subjects