Learning Ruby
By Michael Fitzgerald
First Edition
May 2007
Pages: 255
ISBN 10: 0-596-52986-4 |
ISBN 13: 9780596529864




(Average of 8 Customer Reviews)


Book description
You don't have to know everything about a car to drive one, and you don't need to know everything about Ruby to start programming with it. Written for both experienced and new programmers alike, Learning Ruby is a just-get-in-and-drive book -- a hands-on tutorial that offers lots of Ruby programs and lets you know how and why they work, just enough to get you rolling down the road.
Full Description
You don't have to know everything about a car to drive one, and you don't need to know everything about Ruby to start programming with it. Written for both experienced and new programmers alike,
Learning Ruby is a just-get-in-and-drive book -- a hands-on tutorial that offers lots of Ruby programs and lets you know how and why they work, just enough to get you rolling down the road.
Interest in Ruby stems from the popularity of Rails, the web development framework that's attracting new devotees and refugees from Java and PHP. But there are plenty of other uses for this versatile language. The best way to learn is to just try the code! You'll find examples on nearly every page of this book that you can imitate and hack. Briefly, this book:
- Outlines many of the most important features of Ruby
- Demonstrates how to use conditionals, and how to manipulate strings in Ruby. Includes a section on regular expressions
- Describes how to use operators, basic math, functions from the Math module, rational numbers, etc.
- Talks you through Ruby arrays, and demonstrates hashes in detail
- Explains how to process files with Ruby
- Discusses Ruby classes and modules (mixins) in detail, including a brief introduction to object-oriented programming (OOP)
- Introduces processing XML, the Tk toolkit, RubyGems, reflection, RDoc, embedded Ruby, metaprogramming, exception handling, and other topics
- Acquaints you with some of the essentials of Rails, and includes a short Rails tutorial.
Each chapter concludes with a set of review questions, and appendices provide you with a glossary of terms related to Ruby programming, plus reference material from the book in one convenient location. If you want to take Ruby out for a drive,
Learning Ruby holds the keys.
Browse within this book
Cover
| Table of Contents
| Colophon
Featured customer reviews

A good introduction, with a few annoying errors,
June 02 2008
Submitted by
Forrest
[
Respond |
View]
Overall, this is a very good introduction to the Ruby language.
There are, however, a few annoying errors (some reflected in the user-contributed Errata) that can throw a new user off. In particular, he doesn't often explain some of the functions he uses like "p" and its significance to other similar functions, which can be confusing.
Hopefully a second, expanded edition is in the works that will have these corrections and more material for the new user to learn from.
Read the description and you'll get what you want from this book,
January 31 2008
Submitted by
Matt Polito
[
Respond |
View]
Learning Ruby is exactly what the title says. This book offers a great 'introduction' to Ruby as a fun, powerful language. Now I would say that as a Ruby user, I'm not quite advanced but not really a beginner. I would have to say that this book is definitely catered to someone very new to the Ruby world. The books author, Michael Fitzgerald, uses a very easy to read style of writing that, to me, made this read far easier than a normal technical book. He uses this same easy to follow/read style in Ruby Pocket Reference (http://www.oreilly.com/catalog/9780596514815/?CMP=AK) and Learning XSLT (http://www.oreilly.com/catalog/learnxslt/index.html) as well.
Inside you will find small easy to digest chapters that give a quick explanation on what you'll need to know such as: blocks, arrays, loops, functions. The basic stuff that will lay the groundwork. I believe that the books description may be the most accurate depiction of this book. It does not lie about it's intent. Going in you will know that this is a book that will show you how to get started and really primes you for other more in-depth books (The Ruby Way).
Personally I didn't really understand why at the end of the book you get an extremely brief introduction to Rails (http://www.rubyonrails.org) . The only reason I think is because on the cover you get a tagline of 'The Language That Powers Rails.' So they kind of needed to put something in there. That is really the only grief I found with the book. While doing some searching for other reviews of this book... I found that many people didn't like it, but I truly believe that those people may have already been using Ruby for a bit. Then of course this book would seem like a waste. It is what it is and that's a beginner's introduction.
Rated: *** out of 5
Re: Good, but buggy,
January 09 2008
Submitted by
Michael Fitzgerald
[
Respond |
View]
I am not sure what you mean by this: "...the requirement of parenthesis to arguments that appeared recently." To discuss this directly, feel free to contact me via http://www.oreillynet.com/pub/au/1365.
Read all reviews
I want my money back,
January 09 2008
Submitted by Anonymous Reader [
Respond |
View]
Thank you. These lines will be replaced with the following in the next edition or printing:
r1 = rand(6) + 1
r2 = rand(6) + 1
total = r1 + r2
Thanks to Adrián Mugnolo of Buenos Aires for this improvement. It should have been obvious to me. Feel free to contact me Shiro directly through my author page:
http://www.oreillynet.com/pub/au/1365
I want my money back,
January 01 2008
Submitted by
ShiroNanami
[
Respond |
View]
When you have code like this:
[An example of rolling 2 dices]
r_1 = rand(6); r_2 = rand(6)
r1 = r1>0?r_1:1; r2 = r2>0?r_2:6
And a comment like this:
"...a little fancy footwork to make sure it does not return 0..."
These are signs that you just got duped.
Obviously the author isn't well-versed in Ruby.
No feedback, lots of errors, low on technical.
More importantly, this thin book has a price of a THICK book.
Good, but buggy,
October 02 2007
Submitted by Anonymous Reader [
Respond |
View]
I agree with a previous poster, there are several syntactical (and logical) bugs here. One of them doesn't take into account the requirement of parenthesis to arguments that appeared recently.
The lack of response to the bug reports is a bit of a turnoff, considering we paid for the book.
Also, though the book says this is available for free online for 30 days; when I checked, it was not (that's false advertising).
Should be titled: Learning Ruby *Fast*,
October 02 2007
Submitted by
Scott Schram
[
Respond |
View]
Michael Fitzgerald directs his book "Learning Ruby" to two audiences:
* "experienced programmers who want to learn Ruby"
For this audience, the book excels. The author suggests that experienced programmers "read the code, skim the explanations as needed". Ruby syntax is very readable, so this works very well. An experienced programmer could learn Ruby in about a day using this technique. You won't know every intricacy of the Ruby language, but you'll know enough to start reading and writing in the real world and where to look for more information.
* "new programmers who want to learn to program"
I think most new programmers would be comfortable with more explanation than this book provides. However, the examples are small, and with some hands-on using Ruby's interactive interpreter (irb) it might work for some.
Following the introduction to the Ruby language, the author includes:
More Fun with Ruby - a mixture of topics including sprintf (for formatting strings), XML handling libraries, RubyGems (a package utility for Ruby that provides access to a repository of re-usable libraries), rDoc (the Ruby documentation generator) and a light introduction to some other advanced topics.
A Short Guide to Ruby on Rails - a nice introduction, followed by a short tutorial.
A Ruby Reference.
A glossary of Ruby terms.
Throughout the book, the author points out planned additions to version 1.9 of the Ruby language. Those changes would not make this book obsolete.
Buggy,
September 13 2007
Submitted by
Virgininan
[
Respond |
View]
The challenge for this book is not that it has errors, it is that their are little to no feedback on the errata page from the author, or responses to user submitted issues.
An introduction to Ruby,
September 09 2007
Submitted by
-jason
[
Respond |
View]
Having never been exposed to Ruby I decided on this book to begin learning the language. At first glance this book isn't a big overwhelming manual as is obvious from the number of pages, but rather a very achievable read that covers the necessary topics of learning a language.
The author starts out by discussing some basic commands, and an overview of the book. This first chapter also includes information on how to get and install Ruby on various operation systems.
By the second chapter the author is giving an overview of the Ruby language that gives the reader some idea of what to expect. And then its off to learning the syntax much as you would expect when learning any language.
For the curious the chapter subjects continue as follows. Conditional statements, strings, math, arrays, hashes, files, classes, more fun with Ruby (covers things like XML, Tk, RubyGems and Rdoc), and finishes up with a brief introduction to Ruby on Rails. The author also includes a great Ruby Reference as an appendix.
Check out the book online for more information:
http://www.oreilly.com/catalog/9780596529864/index.html
CONCLUSION
--
This is a simple book that does a great job of explaining to the reader the basics about Ruby. I liked this book and would recommend this book to those looking to learn Ruby or as a reference. I really liked this book, but I only gave it 4 stars because a 5 star rating means definitive and this is book is not a definitive reference, it is a basics book.
A Great Ruby Primer,
August 11 2007
Submitted by
Dave Walz-Burkett
[
Respond |
View]
If you are new to Ruby, there is an O'Reilly title you may want to check out: Learning Ruby by Michael Fitzgerald. This book is a short and concise introduction to the Ruby programming language that will help any Ruby newbie come up to speed quickly. At 238 pages, it is a light, easy read.
Experienced programmers will find a book that jumps right in and introduces language features one after another. The basics are covered in the first chapter, followed by a fairly comprehensive 'Quick Tour of Ruby' in the second chapter. After that, each chapter spends more time with a certain aspect of Ruby, like conditional operators, strings, math, arrays and hashes, files and classes.
The detailed chapters are followed by a chapter that covers some extras like processing XML, working with dates and times, reflection, metaprogramming, and exception handling among other topics. A final chapter takes a dip into the Ruby on Rails framework with a quick, 18 page tour.
The book finishes with a 'Ruby Reference' in Appendix A and the answers to the end-of-chapter questions in Appendix B. The Ruby Reference packs a lot of info into a handful of pages and is a great shortcut to the online documentation if the book happens to be next to your computer.
I enjoyed reading this book and the author's sometimes irreverent writing style.
Media reviews
"This is a well-thought-out well-presented introduction to Ruby. If that's what you want, I'd go for it."
-- George Woolley,
Oakland Perl Mongers
"From the basic features of Ruby and how to use regular expressions to using operators, arrays, and modules,
Learning Ruby is perfect for learning: each chapter concludes with review questions, making it the perfect 'course in a book' as well as a basic computer library reference."
-- James Cox, The Bookwatch - Computer Shelf
"This book is a short and concise introduction to the Ruby programming language that will help any Ruby newbie come up to speed quickly...Experienced programmers will find a book that jumps right in and introduces language features one after another...I enjoyed reading this book and the author's sometimes irreverent writing style."
-- Dave Walz-Burkett, Albuquerque Ruby Group
Read all reviews