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
"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.
|
|
|
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.
|
|
|
8 of 9 people found the following review helpful:
5.0 out of 5 stars
The Perfect Way to Learn Ruby..., July 19, 2007
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!
|
|
|
Most Recent Customer Reviews
|