Å·±¦ÓéÀÖ

Jump to ratings and reviews
Rate this book

Ruby by Example: Concepts and Code

Rate this book
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:

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.

326 pages, Paperback

First published June 8, 2007

6 people are currently reading
16 people want to read

About the author

Kevin Baird

9Ìýbooks

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
6 (20%)
4 stars
9 (30%)
3 stars
12 (40%)
2 stars
2 (6%)
1 star
1 (3%)
Displaying 1 - 4 of 4 reviews
Profile Image for Fotis Koutoulakis.
117 reviews13 followers
October 13, 2023
I got this book from a Humble Bundle package and I got to read it as I was scouring my library for Ruby related books (I'm starting to be more and more enamoured by Ruby).

I was pleasantly surprised by the book in the sense that it comes from 2007 and describes code in an ancient (by today's standards) version of Ruby, with techniques that to the best of my understanding are a bit anachronistic now (heredocs for method documentation or Unit::Test for testing instead of minitest or RSpec), but the code worked quite well with my Ruby 3.2 locally on my M1 Mac mini.

There were a couple of cases where I had to make some small changes to the code to get it to run (hence why I wouldn't recommend the book to a total Ruby Beginner, unless it's a very experienced programmer overall), but the code worked and in some cases it was also very intricate (the evolution model from the Blind Watchmaker as an example).

The only negative of the book is that it was too repetitive in terms of code samples (most of them were patterns along the lines of `hash.keys.sort.each do |key| do_something(key) end`, which while I admit that this is what most Ruby looks like, it missed the chance to show more of functional programming in Ruby.

Note: I also skipped the last chapter on Rails, on the assumption that Rails being a library will probably have moved quite a bit since 2007, so I didn't expect the code to run. That plus the fact that I plan to read a book dedicated to Rails in any case, so I felt like I could make do without reading the chapter for now.
6 reviews
November 14, 2017
This book is not complete guidance but a good start for bottom-up learner who wants to jump out into Ruby.
Displaying 1 - 4 of 4 reviews

Can't find what you're looking for?

Get help and learn more about the design.