Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Image

Head First Rails 57

Anita Kuno writes "I suggested Head First Rails to a friend before I even finished it. He was asking me questions that I didn't have time to answer, and I knew the book could explain better than I. My friend is impatient, and I was uncertain what his experience would be. At first he was frustrated, but I assured him the answers were in the book. The incremental style of Head First Rails includes some exercises that are designed to fail to reinforce the learning process. I was confident that his answer would be found in the pages and he trusted me enough to go back and continue the exercises. He later told me he is very happy with the book and grateful that I suggested it." Read on for the rest of Anita's review.
Head First Rails
author David Griffiths
pages 429
publisher O'Reilly
rating 8/10
reviewer Anita Kuno
ISBN 978-0-596-51577-5
summary An Introduction to Ruby on Rails


Rails is a framework for creating web applications. It is written in Ruby. It uses a structure called MVC which stands for model view controller. Rails separates tasks so that operations are modularized. Once a development team understands Rails, its use can increase the speed of creating web applications. Head First Rails explains the beginning steps needed to create Ruby on Rails applications. It introduces vocabulary; teaches the basic relationships that comprise Rails: the model, the view, and the controller; and demonstrates code creation that controls the MVC interaction. The title 'Head First Rails: A Learner's Companion to Ruby on Rails' describes the approach of the book. The author acknowledges that this book is one of many that will assist the active learner to begin Ruby on Rails. Proficiency in the Rails framework requires accumulating information from a number of sources and the book mentions quite a few and encourages consultation of those resources.

While previous Rails experience is not required (nor is previous Ruby experience) it is expected that the reader have a working understanding of HTML & CSS as well as a basic understanding of a scripting language. Java, C# or PHP are mentioned as scripting examples. I had tried several beginning Rails books previously and Head First Rails was the first I could complete. I feel it is a reflection of the speed of development of the framework and the fact that most of the people that I know involved with Rails are so busy creating apps, they don't have time to teach the n00bs.

Head First Rails assumes that you already have Rails installed on your system. The home page for Head First Rails provides a link to the download page at rubyonrails.org by way of providing installation instructions. I didn't see a reference in the book's index to Rails installation, which I find rather odd. It would be a simple matter to include a short paragraph explaining why detailed instructions aren't included with the book (as is explained on the home page for the book) with a URL to the book's homepage. Ruby and Rails are both opensource software so they are freely available for all systems.

Head First Rails has images, illustrations and graphics that are used to introduce and underscore one concept at at time. The book is designed so that each page and its facing page comprise an experience of one concept. As you turn each page you are introduced to a concept, given details and challenged in some form. When you turn the page you are on to the next piece of information which builds upon what you have already learned. The format of the book is designed to promote information retention and some of the exercises may prove frustrating at certain points. The frustration promotes original thinking and information retention. I feel it is a valuable part of learning. Since I rarely have the time to focus on a book exclusive to the rest of my life, I find the format helpful. I can attend to other things and pick up the book after two weeks and continue from where I left off. It is helpful to have access to information that I can pick up and put down and still accumulate knowledge.

Head First Rails is conversational and encourages original thought. The exercises, which are the foundation of the book, are accompanied by code samples for download to encourage comparison. The first time we dive into an app and edit the specific files, I felt that the identification of which file we were editing and how to locate the file in the Rails application directory tree needed to be clarified a little better. Soon the examples fell into a rhythm and I knew where to find the information I needed.

One thing that did get my attention was the use of whitespace or lack thereof in code. I have been taught to use 2 spaces to indent Ruby code (which affects Rails code as well) and while the code samples did use the convention, I didn't see the indent by 2 spaces rule explicitly stated. I'm not confident that a n00b would just pick that up. They would probably have to be informed. My other whitespace comment concerns hashes. I have been taught to have one space between the key and hash delimiter and another single space between the hash delimiter and the value. I did not see this in the code samples. I frequently saw no space whatsoever separating the key, delimiter and value. I have come to understand that developers rate another developer's worth based upon code samples, and lack of whitespace when it is expected is viewed as a bad habit. The composer of said code might be either chastised or dismissed due to poor technique. Perhaps my understanding of the situation is extreme but again in a book for n00bs, the reader will copy exactly what they see. So if there isn't whitespace on either side of the hash delimiter in the book, how will the reader know to compose code using that convention?

A few of the author's terms were confusing. He uses the term 'scriptlets' to refer to ERB output tags, and 'expressions' to refer to ERB expression tags. The Rails developers I questioned about this were able to figure out what he meant by 'expressions' but none of them had ever heard of ERB output tags being called 'scriptlets'. Also, the author uses 'finder' to refer to dynamic finders and I think it would have been useful to use the term 'dynamic finder'. It is more specific and the keyword 'dynamic' is useful when employing a search engine to research the functionality of dynamic finders. A search for 'finders' doesn't return one Rails related hit on the first page, while a search for 'dynamic finders' gives me a Rails related hit as the first return.

These are small points and perhaps this is more reflective of the culture of Rails developers that informs me, but in a n00b book it is important to provide clear vocabulary and conventions. These small points may be the techniques that have the longest shelf life to the reader.

I have been waiting for this book to be written and available for at least a year and a half. This was the first beginning Rails book that I found that didn't assume I was transitioning from a background in PHP. I have been spending time with the Ruby and the Rails community for close to 2 years now and am grateful that I finally have an explanation of the topic that is accessible for me.

Rails is changing very quickly and even now is about to merge with Merb to create Rails 3.0. It is tough to say how long the information in Head First Rails will be relevant. If you are interested in this book because you think Rails is fashionable, you might be distracted by a new trend before you finish the book. If you are interested in Rails because you have seen what it can do, you recognize its power and you want to learn how to get that for yourself, you will recognize the value in these pages.

You can purchase Head First Rails from amazon.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.

Head First Rails

Comments Filter:
  • by gbulmash ( 688770 ) * <semi_famous@ya h o o .com> on Wednesday April 22, 2009 @02:59PM (#27677527) Homepage Journal
    "designed to fail to reinforce the learning process"...

    I'm sure that's meant as "designed to fail, so that figuring out why they failed reinforces the learning process" but it reads as they're designed so that they fail to reinforce the learning process.
    • Re: (Score:3, Funny)

      by Anonymous Coward

      Public Schools: "designed to fail to reinforce the learning process"

  • Head First series (Score:4, Insightful)

    by oldspewey ( 1303305 ) on Wednesday April 22, 2009 @02:59PM (#27677531)

    I have to say, despite the goofy approach and crazy graphics in the Head First series, they are an effective learning tool and a more enjoyable read than a "standard" technical book for beginners.

    After reading Head First Java, memory management shall forever be linked in my mind with worried ducks.

    • I have to say, despite the goofy approach and crazy graphics in the Head First series, they are an effective learning tool and a more enjoyable read than a "standard" technical book for beginners.

      I hear that a lot and they've done a lot of research into their methods, so I'm probably atypical and possibly just weird...

      I've spent some time with the Design Patterns one and I struggle with it (I really want to like it). Sure it did OK with higher level stuff like "why" you want to use them (and "why not" too,

  • by the1337g33k ( 1268908 ) on Wednesday April 22, 2009 @02:59PM (#27677533)
    But I wouldn't want to go head first down a rail...
  • Do people actually read these books cover to cover? I at best just skim through them and read the parts that interest me. I don't have the time to read 700 page technical book where 70-80% of content is either redundant or irrelevant.

    • The redundancy is part of the point...it reinforces the point they are trying to make in different ways to improve recall. Oh, and I've read two of these cover-to-cover, and am working on my third. No other technical book has taught me any subject as well, nor have I been able to complete any technical book I've tried to read before these.
  • My Summary (Score:4, Funny)

    by raftpeople ( 844215 ) on Wednesday April 22, 2009 @03:27PM (#27677849)
    I picked up the book.
    I opened it to the first page.
    He said he hadn't read that page.
    I hadn't either.
    He read it.
    Then I read it too.
    We both read the page.
    Then we talked about it.
    The page had information.
    We talked about the information.
  • Xdoclet was the straw that drove me from Java to Rails. All that Java jargon just blew my mind.

    So when I saw scriptlet used in a Rails context, I had a visceral reaction.

  • It's a bad summary.

    Make your own then [rapidlibrary.com]

  • "Java, C# or PHP are mentioned as scripting examples."

    Why not 8086 Assembly or Forth while we are at it, as opposed to oddballs like Python.

  • RESTfully deficient (Score:4, Informative)

    by mailman-zero ( 730254 ) on Wednesday April 22, 2009 @03:31PM (#27677897) Homepage

    I started trying to learn Rails with this book, but found the dearth of RESTful development methodology leaves this book almost completely useless. Best practices are important to learn especially when just starting out. I would recommend Simply Rails 2 [sitepoint.com] as a much better starting point for the beginner. I switched over to Simply Rails 2 and it provided a much better foundation upon which to build a working knowledge of Ruby on Rails.

    I am not alone in this assessment. Here is just two people that think the same thing [amazon.com].

    • I started trying to learn Rails with this book, but found the dearth of RESTful development methodology leaves this book almost completely useless.

      Looking at the front cover picture, I would have been extremely surprised if it wasn't completely useless.

      What's next, "Ashton Kutcher ROCKS THE COBOL"?

      • Looking at the front cover picture, I would have been extremely surprised if it wasn't completely useless.

        What's next, "Ashton Kutcher ROCKS THE COBOL"?

        The Head First series is actually excellent. The concept is good and I've used other Head First books and learned a lot with them. It isn't the Head First part that is bad, it is the code.

    • by IdahoEv ( 195056 )

      My favorite start point is RailsSpace [amazon.com] because it does a better job at introducing the basic concepts of Ruby than the other tutorials out there. I tried "Agile Web Development With Rails" for a while and learned much faster once I switched.

      I think the name is poorly chosen - it uses a social networking site as an example app to build, but the concepts are applicable anywhere.

    • I'm a n00b programmer but a decent technician. Head first books were the best for me when starting programming. Its not going to be the best for most slashdotters but for taking your first steps with a programming language its by far the best.
  • What about a book on Merb?

    Some projects have already migrated from Rails to Merb, and Rails 3.0 is going to use Merb's code base.
  • by Sponge Bath ( 413667 ) on Wednesday April 22, 2009 @03:56PM (#27678223)
    Apply directly to the forehead!
  • Terrible review (Score:5, Insightful)

    by Moebius Loop ( 135536 ) on Wednesday April 22, 2009 @04:16PM (#27678497) Homepage

    I've never felt compelled to post a "why is this on /." comment, but this review pushed me over the edge.

    This was by far the least informative review I've ever seen posted here, and it's a close contender for the most poorly written one.

    First there's the fact that the reviewer's greatest criticism was that the author failed to discuss whitespace usage -- in a non-whitespace-sensitive language no less. The reviewer mentions that many books assume expertise with PHP or another scripting language, I wonder what exactly this reviewer's background is to be so concerned with such a detail.

    Next, we've got the constant usage of 'n00b'. Okay, using 'n00b' might be funny or quirky if you use it once, but the rest of the time, let's try for a modicum of professionalism. I've may have never written in Ruby before, but it's a gross understatement to refer to me as a 'n00b'.

    The rest of the review reads like it was written by someone's 14-year-old cousin. I'm not looking for Chaucer here, but nearly every paragraph reads like an itemized list of loosely related topics. On top of that, five of the first six paragraphs could be describing basically *any* programming book: "The book is split into chapters that each cover a topic. Sample code is provided. Sometimes it's fully explained. Sometimes it's not. The book assumes you know some things already, but don't know other things."

    Like I said, it's honestly not my habit to complain about free stuff, and I know the pointlessness of asking for greater editorial oversight from the /. staff. I would just like to suggest to anyone that's thinking about writing a technical book review to learn from these mistakes, or at least make an effort to study other tech reviews as guides to style and content.

    • by Gizzmonic ( 412910 ) on Wednesday April 22, 2009 @04:55PM (#27679041) Homepage Journal

      I'm not looking for Chaucer here, but nearly every paragraph reads like an itemized list of loosely related topics.

      Verily, the Goodwife of Bath bespouke of many a Challenge to Programming Railes Dexterously. Forthwith, Rails had Not Been Invented in the Twelfth Century of Our Lord. Thus, her gentle wares stoop'd belowest the Most Odious Keyboard festoon'd with Discarded Wrappers of Doritos. All at Comdex Merchant Festival were most mov'd by her mellifluous gabbing and comely visage.

    • Re: (Score:1, Offtopic)

      by HunterD ( 13063 )

      My 2c, this review is entirely the norm for the rails community.

      This is a community of 'developers' who spend (so far as I can tell) the vast majority of their time coming up with names (rails, merb, cucumber, etc) and writing blog posts [zedshaw.com] (yes, I get the irony of pointing at *his* blog) about how badass they think are, while writing trivial libraries and using that to trumpet how 1337 they they think they are. Both this review and likely this book should be passed up, along with the rails community as a who

  • Head first rails (Score:3, Insightful)

    by tsa ( 15680 ) on Wednesday April 22, 2009 @05:17PM (#27679361) Homepage

    Sounds like a way to commit suicide.

  • No wonder Ruby people look so dazed when using the technology.
  • Seems like the Ruby On Rails guys lost their domain name!!!! Try www.rubyonrails.org and you'll see!!! I can't believe this!!!

I have hardly ever known a mathematician who was capable of reasoning. -- Plato

Working...