Book Review: Advanced Rails

by Reuven Lerner - Mar. 22, 2008Comments (0)

Advanced Rails, by Brad Ediger. Published 2008 by O'Reilly and Associates.

Ruby on Rails has become, over the last few years, the latest hit among Web application developers. While it is often compared with Perl, PHP, and Java, Rails is not a programming language. Rather, it is a framework for creating Web applications. This means that Rails is a set of libraries and classes which make it easier to create a Web application in Ruby.

This description might make Rails seem somewhere between mundane and trivial. But all software is a bunch of such libraries and classes, giving programmers a layer of abstraction that helps them to focus on their ideas, rather than how those ideas are implemented. The best such frameworks can give programmers a massive advantage, both over their competitors and over their previous ways of working.

Rails has succeeded, in no small part, because it identified many of the areas in Web development where programmers were frustrated, and provided elegant solutions. I have been creating Web applications using Rails for nearly three years, and I enjoy nearly every minute. Rails fits with the way in which I create sites, and gives me an amazing amount of power and flexibility. Best of all, someone who understands Ruby programming and Web development can jump right into using Rails, creating their first application very quickly.

But of course, Rails is a software framework, not a miracle drug. This means that at some point, all Rails developers hit a brick wall of some sort. In many cases, you need to understand what the system is doing behind the scenes, in order to make the best of it. In the case of Rails, there are also many techniques, objects, methods, and configuration options that can escape the attention of even the most devoted Rails fanatic. And if you add the various Ruby gems and plugins, then it's hard to believe that anyone can keep track of everything.

This is why I have been reading and enjoying -- and using -- Advanced Rails over the last month or so. This book, written by experienced Rails hacker Bran Ediger, is a compilation of the "greatest hits" of Rails programming that you might want. It doesn't go into the same level of detail in each chapter, but I understand that going into depth on every topic would have made the book unnecessarily thick. Besides, the book contains a very large number of URLs, pointing to essays and software that will come in handy. The author generally avoids re-documenting things for which good documents are available online.

The first two chapters are an introduction to Rails aimed at experienced Rails programmers. They cover topics ranging from Ruby storage internals to RailTies, the part of Rails that connects ActiveRecord with other core objects -- including a discussion of how requests are processed.

Additional chapters describe plugins, database connectivity, security, and performance. I have referred to each of these chapters at least once in the last few weeks for my own work, and have discovered a number of resources, including Ruby gems, that I would not have otherwise known about. Ediger does not provide clear-cut answers to issues of security and performance, but that's OK; I would prefer to have a book that lays out the trade-offs and encourages me to make intelligent decisions regarding them, than a blanket "here's how to make your site faster," which fails to take into account many potential issues.

The rest of the book describes additional areas that are often misunderstood, including Web services, internationalization (with a section on Unicode), and extending Rails.

Advanced Rails, as the title implies, is not a book for beginners. If you have been using Rails for a number of months, and feel ready to take your skills to the next level, this book is an excellent resource to have around.



Kartik Subbarao uses OStatic to support Open Source, ask and answer questions and stay informed. What about you?




Comments

image
Share Your Comments

If you are a member, to have your comment attributed to you. If you are not yet a member, Join OStatic and help the Open Source community by sharing your thoughts, answering user questions and providing reviews and alternatives for projects.