Slashdot Mirror


Agile Web Development with Ruby on Rails

Ridgelift writes "Learning to develop web applications with Ruby on Rails has gained a huge amount of interest lately, but for people wanting to learn Rails there are no books on the subject. That's changed now with the pre-release of Agile Web Development with Ruby on Rails , the latest book from Dave Thomas and the author of Ruby on Rails David Heinemeier Hansson. It's really 3 books in one: a full Rails tutorial, an in depth guide to the components that make up Rails, and an introduction to developing applications using the Agile development model. There's even a quick introduction to Ruby, the language Rails is built with." Read on for an early review of the beta book. Full disclosure: Reviewer Miles K. Forrest points out that he has read earlier versions of the book's manuscript and provided critiques to the authors. 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
AWDRoR can get away with this because Rails itself was designed around the principles of Agile software development. The tutorial is probably the best I've ever read. You really come away from it knowing not only what you've written, but why, as well as picking up a few expert developer tips along the way.

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.

7 of 222 comments (clear)

  1. Re:Charge for Beta PDF and booK? by braeburn · · Score: 3, Informative

    They sell their book as either a PDF or a physical book, the PDF being cheaper. You can buy the beta PDF and when the book is released you'll get the final PDF. Or, a little more money, you can buy the PDF and get the physical book when it comes out.

    Considering the normal cost of technical books, I think it's a sweet deal. These are not small books.

  2. Re:Charge for Beta PDF and booK? by Peter+Cooper · · Score: 4, Informative

    Incorrect. If you buy the book now, you'll get the beta PDF and the book when it comes out. Likewise, if you just buy the PDF, you'll get the full PDF when it's all done. You are not just buying a beta in either case.

  3. Re:Suggestions by abigor · · Score: 2, Informative

    CherryPy is quite nice (Python-based web app framework). Very quick to get stuff up and running.

  4. Re:Since when does "huge" apply to Ruby? by Peter+Cooper · · Score: 3, Informative

    Since 1000 people bought the book within the first week or two, I guess not. We have more than 200 people in #rubyonrails on irc.freenode.net alone, and this makes up a fraction of the community.

  5. Your math sucks. by nacs · · Score: 2, Informative

    It's $22.50 for the PDF by itself or $43.75 for the dead tree book and the PDF.

    In other words, the printed book is $21.25 if you take out the cost of the PDF.

    I purchased the combo the day after it was released and must say it's more than worth the price.

    --
    "I filter at +6, and have yet to miss out on an important comment." (#822545)
  6. Re:Better than Java, or just easier? by Peter+Cooper · · Score: 2, Informative

    The business analysis: If you're working on high-end enterprise apps, or apps that demand a very long term investment, I'd say stick with JSP. Rails isn't there yet. If you're working on Web apps with a small(ish) development team and are mostly concerned with getting something out there that's secure, quick, and full featured quickly then Rails is, really, the only way to go.

    The coding analysis: Ruby has a lot of semantic advantages over Java. It's easier to read, has less syntactic salt, and encourages test-driven development a lot more. It's also easier to migrate to from other languages, and most RoR coders are very recent migrants from either Java, PHP or Perl. RoR is easier than Java, and in many cases this would mean "better", but... "better" is highly subjective. I'd still say Java is preferable at enterprise level, but Rails more than has its place, and kicks Java's butt when it comes to rapid, reliable development with a small team.. but Java.. it's all about the enterprise.

  7. Re:Wow by nacs · · Score: 2, Informative

    The tutorial really is one of the best I've ever read, spans 131 pages and walks through building a high quality app with an administration interface and unit testing thrown in.

    Many /.ers are seeing the 'beta' line and automatically equating it with 'crap'. The actual book, however, is excellent even in it's beta stages and is easily better than many of the non-beta technical books I own.

    This book is written primarily by Dave Thomas who wrote pretty much the definitive book on Ruby and who was kind enough to contribute the first edition of the book to the Ruby community (you can read it online here).

    --
    "I filter at +6, and have yet to miss out on an important comment." (#822545)