Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×

Ruby For Rails 173

Simon P. Chappell writes "This may not be the book that you think it is, if you don't read the title carefully, but it is the book you need, if you are developing applications for Ruby On Rails (often known as just Rails, or RoR, to its friends). When learning any new development platform, there are many idioms and approaches, best practices if you will, that can benefit your development efforts. This book sets out to bring you that understanding of the best way to write the Ruby side of your Rails application." Read the rest of Simon's review.
Ruby For Rails
author David A. Black
pages 493 (17 page index)
publisher Manning
rating 10/10
reviewer Simon P. Chappell
ISBN 1932394699
summary A stunningly well written explanation of real-world Ruby skills for Rails development.


I see two main audiences for this book. The first group would be those who are learning to develop Rails applications and need some help with their Ruby skills. The second group would be those who already have good Ruby chops, but who want to learn the primary Rails idioms and techniques. Naturally, there is always the curious geek crowd who might find the twofer of an introduction to writing real-world Ruby and a hype-free description of what Rails actually brings to web development, to be quite attractive. I place myself firmly in the third group, but after reading this book, I'm ready to move to the first group.

To quote it's own website, "Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern." The first thing this tells us is that like any framework worth it's salt, it is fully buzzword compliant. The second thing it tells us is that it really does try to help with every layer of your application, from providing a full controller to automatically mapping your data objects to their respective backend database tables. Oh, and with the bare minimum of configuration files to boot! For those of us who have developed web applications with Java, this is a welcome break.

The first part describes "The Ruby/Rails Landscape" and has three chapters that describe how Ruby works, how Rails works and then shows a very simple example of Ruby-enhanced Rails development.

The second part describes "Ruby Building Blocks" spanning five chapters, four through eight. This part is a very good tutorial style introduction to Ruby. Chapter four introduces objects and variables with chapter five showing how to organize those objects with the concept of classes. Chapter six introduces us to modules and program organization in general. Chapter seven talks about the default object, self, and scope. Chapter eight covers control flow techniques. This is more than just a fancy way of saying conditionals and loops, because it includes one of the better explanations of closures that I've read to date.

The third part describes "Built-in Classes and Modules", in chapters nine through thirteen. Chapter nine covers some of the Ruby language essentials for Ruby development in the trenches. These include useful syntactic sugar, the family of methods that change data "in place" rather than returning a modified copy, some of the tricky aspects of the Boolean objects and the proper ways to compare two objects so that you get a comparison on their contents, which is likely to be what you want, rather than their memory location. Chapter ten looks at scalar objects: strings, symbols, numbers, times and dates. Chapter eleven examines the Ruby collections: arrays and hashes and discusses when you would use each one, based on their relative strengths. Chapter twelve looks at the regular-expression facilities within Ruby and chapter thirteen wraps up our tour of Ruby with some of the dynamic aspects of the language, including the "eval" family of methods that allow a Ruby program to run arbitrary code.

The fourth and final part describes "Rails Through Ruby and Ruby Through Rails". To quote the book, the purpose of the fourth part is "helping you get more out of Rails by knowing more about Ruby." To this end the simple application created in the first part of the book is revisited and revised. Chapter fourteen starts us out with remodeling the application written back in chapter three. Chapter fifteen looks at programmatically enhancing ActiveRecord models. Chapter sixteen covers the options available for enhancing the controllers and views. Finally, the part wraps up with chapter seventeen where techniques (and much encouragement) for exploring the Rails source code are shared.

The writing is excellent and the style is very engaging. Every concept is stunning well explained. Much as I liked and enjoyed "Programming Ruby" (the "pickaxe book" to it's friends) by Thomas, Fowler and Hunt, this book takes the state of Ruby writing to a new level.

The progression of the book is very well thought out. The first part introduces us to both Ruby and Rails. You can create basic Rails applications with very little Ruby and that's exactly what this first part walks you through. Then parts two and three teach Ruby skills and idioms that are directly applicable to Rail application creation. Part four takes these new skills and shows them being applied to the second Rails application of the book. I found this to be a very good sequence for progressing through the material.

The examples in the book are excellent and many of them are geared towards Rails-style situations. This not only helps to teach Ruby skills, but also keeps the Rails context firmly front and center during the process.

The index on this book is a magnificent 17 pages. That's not something you see too often.. The art of a good index seems to be somewhat lacking these days, but this book helps to redress the balance.

If Ruby on Rails is of no interest, then this book is most likely not the one you want. Also, if you were looking for something with an exhaustive, reference-style, coverage of Ruby, perhaps you'd be better off considering something like the "Programming Ruby" book.

This is a great book, that's very easy and enjoyable to read. It's a stunningly well written explanation of real-world Ruby skills for Rails development."


You can purchase Ruby For Rails from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page
This discussion has been archived. No new comments can be posted.

Ruby For Rails

Comments Filter:
  • by Anonymous Coward on Wednesday July 12, 2006 @04:40PM (#15708188)
    My boss is a buzzword-whore w/o english knowledge... and I can really imagine him how he'll do the locomotion when he'll talk BS about "Ruby for Rails" because he has seen it on top of some important-could-be Slashdot article...

    I work in hell!!!
  • Oh Ruby... (Score:4, Funny)

    by Penguinshit ( 591885 ) on Wednesday July 12, 2006 @04:45PM (#15708231) Homepage Journal

    Every time I see the name "Ruby on Rails" it reminds me of this coke-whore who lived in my college dorm...

  • by Outland Traveller ( 12138 ) on Wednesday July 12, 2006 @04:56PM (#15708327)
    Guido van Rossum was heard exclaiming that he was developing with SNAKES on a PLANE.
  • Re:Oh vey. (Score:5, Funny)

    by Ingolfke ( 515826 ) on Wednesday July 12, 2006 @04:57PM (#15708335) Journal
    I can't wait for the day ruby on rails loses it's buz and the infinite amount of Ruby on Rails has been derailed jokes.

    That's scheduled to occur in conjunction with Web 3.0. Ruby on Rails will be replaced with Pascalian Patterns a dynmaic, distributed, easy-to-use, personal lanuage based on Pascal.
  • Re:Fad (Score:5, Funny)

    by DysenteryInTheRanks ( 902824 ) on Wednesday July 12, 2006 @05:12PM (#15708458) Homepage
    we know for sure that the serving web pages won't be a problem for all time

    Very, very true. When the robots finally rise against us, we will be more concerned with finding shelter from the HoverDrones and their menacing gatling cannons and scavenging food not burned by the fearsome robot fire brigades! Instead of writing CRUD apps, we'll be crawling through sewers with radiation burns, hoping to reach the central meeting point for the remnants of the human resistance.

    Massive raditiation from the nuclear explosions will make the mere thoght of a WiFi, WiMax or cellular Internet connection laughable, and the network will in any case have been repurposed by the robots for their own genocidal ends, a grimly ironic rebuke to the original vision of the Internet as an Apocalypse-proof ARPAnet. And in any case, we'll be a tad more concerned with using baseball bats and snowshovels to bludgeon down waves of robots before they reach our cowering families! Rapid development of Web applications will be a bit of an after thought, no?? HaHA, HuhHAAA!

    When deciding whether to starve or to feast on the remains of one's robot-electrocuted best friend, HTTP cookies will tend to be far from one's mind, eh mate!?!? HA!

    As our once-proud cities burn into molten pools of blood and steel, watched by cold eyes of robot-controlled satellites in heliosynchronous orbit and encircled by robots in rupurposed tanks and SUVs, bearing shoulder-launched rockets, "serving web pages" will be the LEAST of our problems, and we will rue the day we thought of the web AS ANYTHING BUT A FAD!! MWHAHAHA!!!! ... or is that not what you meant?

"And remember: Evil will always prevail, because Good is dumb." -- Spaceballs

Working...