Agile Web Development with Ruby on Rails 222
Agile Web Development with Ruby on Rails | |
author | Dave Thomas and David Heinemeier Hansson |
pages | 506 |
publisher | The Pragmatic Programmers, LLC |
rating | Excellent |
reviewer | Miles K. Forrest |
ISBN | (Book still in beta) |
summary | A complete primer to developing web applications with Ruby on Rails |
At just over 500 pages, Dave Thomas' new book manages to cover a lot of ground in a concise, readable manner. One problem at the outset -- the book is not finished. Knowing that the Ruby on Rails community has been chomping at the bit for morsels of information, Dave and David (DHH) have answered the call by releasing the forthcoming book early. "The book has not had a full technical edit, so it will contain errors. It has not been copy edited, so it will be full of typos. And there's been no effort spent doing layout, so you'll find bad page breaks, over-long lines, incorrect hyphenations, and all the other ugly things that you wouldn't expect to see in a finished book. We can't be held liable if you follow our instructions, expecting to create a Rails application, and you end up with a strange shaped farm implement instead. Despite all this, we think you'll enjoy it!"
And enjoy it I did. The "Getting Started" section of AWDRoR provides a whirlwind overview of the Ruby on Rails' architecture. I found Rails to be very intimidating at first. You can't just cut-and-paste a couple lines of code like you can in PHP. Rails generates all kinds of directories and files, making it feel like your first trip to Disneyland -- you know there's fun to be had, but it's a big place and you don't know your way around. The reason for all this is because, in programming, short simple scripts are easy and simple, full blown Web applications are not. Many LAMP projects developing in perl/Python/PHP and any number of templating engines have started simple, but grown into unruly messes that are difficult to maintain. While trying to grok Ruby on Rails, topics like Model-View-Control and Object-Relational Mapping really don't stick at first. Add to the confusion that many of us are also struggling to learn Ruby and a RDBMS (such as MySQL; Rails works with others databases as well). The overview of Rails is necessary, but I found it to be a lot more helpful rereading it after completing the tutorial section. So if you read through this first section and feel lost like I was, just know that the material will become familiar to you and press on, because it gets a whole lot easier from here on in.
I really enjoyed the Tutorial section, a narrative designing a shopping cart application for a customer. Dave says it best: "Does the world need another shopping cart application? Nope, but that hasn't stopped hundreds of developers from writing one. Why should we be different? More seriously, it turns out that our shopping cart will illustrate many of the features of Rails development. We'll see how to create simple maintenance pages, link database tables, handle sessions, and create forms. Over the next seven chapters, we'll also touch on peripheral topics such as unit testing, security, and making our pages look nice."
Dave begins not with lofty design plans, but with a tool most real programmers use: napkin drawings. Many of us sit down over coffee with a customer and talk about what they need, sketching out ideas with paper and pencil, not some complex software planning tool. Each chapter in the tutorial section allows a story to unfold, where the customer works alongside the developer. Real life situations like changing direction or refactoring code are covered as each programming session is done. You really see why Rails is becoming so popular. It wasn't written by a team of programmers trying to hammer out an arbitrary list of features, but rather Rails was built around a real application (Basecamp). Pragmatic considerations such as developer time, feature creep, and maintenance issues have all been skillfully addressed in Rails. The tutorial reflects this, and at the same time it also gently, almost unknowingly, teaches principles as outlined in the agile manifesto. Some of the goals include:
- Individuals and interactions over processes and tools
- Working software over comprehensive documentation
- Customer collaboration over contract negotiation
- Responding to change over following a plan
The third section, "Rails in Depth," dives into the inner workings of Rails. Components such as ActiveRecord, ActionController, ActiveView, and Web Services (Ajax) are all covered well. There are even chapters on securing and deploying your applications properly. These chapters, in conjunction with the API docs found on www.rubyonrails.org, give a full overview of Rails. Most helpful in this section are the notes and diagrams which help pull everything together. The appendices that cap off the book also provide the full tutorial source code, as well as a brief introduction to Ruby, the language that makes all the magic happen.
In short, Rails is a brilliant architecture, and Agile Web Development with Ruby on Rails is a great book. I'm reluctant to point out its shortcomings as it's still in beta, but it's really hard for me to find much to complain about. It took me some time for the light to come on with Rails, but once it does, you see that Rails could not exist without Ruby, the language it's inextricably woven into. As Dave Thomas is quoted on www.rubyonrails.com, Rails is probably "the framework to break Ruby into the mainstream." Whether you believe the hype or not of "super productivity," "Ten times faster development," and "Better than anything else," Ruby on Rails is a great tool to add to your belt. In fact, I find myself using it exclusively for Web apps, and I catch myself using python and PHP less and less and Ruby more and more for my day to day programs.
If you want to learn Ruby on Rails, Agile Web Development with Ruby on Rails is a great choice, and will probably be the definitive book on the subject.
Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
hmmm (Score:5, Interesting)
I believe that not grokking MVC detracts from the value of your review, particularly with respect to your opinion of the architecture of Rails. Without understanding MVC, you can have no understanding of the design decisions they made, and as such, no qualified understanding of the architecture itself.
This was my only concern. Thanks for the review!
Better than Java, or just easier? (Score:2, Interesting)
So, my question is: is there anything in all that RoR buzz for those who actually have CS degrees and usually do web development with JSP/servlets? Is RoR in any way better than Java, or just easier?
Re:Hard to believe (Score:3, Interesting)
And for the Perl folks out there... (Score:3, Interesting)
Catalyst can be found at catalyst.perl.org [perl.org] or on CPAN [cpan.org].
Re:hmmm (Score:3, Interesting)
If it helps, let me change my statement: In short, Rails is a really, really good architecture 'cause it helps me keep develop code faster and cleaner than anything else I've used, and Agile Web Development with Ruby on Rails is a great book because even newbies can understand it.
So since I readily admit my opinion isn't a qualified one, how about something from O'Reilly instead: [oreilly.com]
Re:Thats fairly meaningless... (Score:1, Interesting)
"Rails is a flexible framework that allows you to keep your house in order when coding Web applications"
Ah. Good to know. Now, can you tell me what does that mean, really?
"encourages test driven development."
Test-write-test development cycles do this, regardless of the language or development 'style'. What you're saying is that RoR does not *prevent* this dev cycle form being employed. This is good to know, but hardly unique to RoR.
"Some people tried to replicate RoR with PHP, and the syntax was vile and full of syntactic salt."
Who, where, when and can we have some examples of syntactic salt?
"Using Rails to develop Web apps, as opposed to, say, PHP, is like using a language that has garbage collection over one that does not."
Yes, and love is like a red red rose.
This tells me very little about RoR and why I should use it. Nearly as much as the old saw tells me about the practicalities of love.
I understand that RoR is a mature programming language in that it offers layers of abstraction. Get in line behind half a dozen other solutions.
What (Score:2, Interesting)