Review: Agile Web Development With Rails, Fourth Edition (Part I)
With a full house of kids, I don’t get as much of a chance to dabble in technologies that I’m not using at work. So, I am much more selective in what I choose to learn. I also seemed to be moving jobs enough and bouncing back and forth between the JVM (Java, Groovy) and the CLR (VB.Net, C#) that I was already expanding my language horizon on an annual basis. While, I’ve been watching Rails from a distance for quite some time, I never seemed to have the bandwidth to take the jump and force myself to sit down and learn it. For whatever reason, I’ve decided that now is the time. After asking several friends which book to start with, I settled on Agile Web Development with Rails [PragPress].
Disclaimer: As of this writing, the fourth edition is still in beta as is Rails 3. I know the book is a work in progress, but I am reviewing it as-is.
The purpose of this blog post is to review Part I: Getting Started. Part I is divided into four chapters: “Installing Rails,” “Instant Gratification,” “The Architecture of Rails Applications,” and “Introduction to Ruby.” These first four chapters are intended to lay the foundation needed to understand the deeper material covered in the rest of the book. Additionally, they serve to whet the appetite of the reader by walking him through some very basic examples.
Chapter 1: Installing Rails
When I first started looking at Rails, I was using the third edition of this book and installing Rails 2. At the time, I was using my Windows 7 box. I found the walk through for installation to be helpful and complete for getting Rails up and running on Windows. This time around, I decided to go with my Ubuntu linux environment. I still needed to install both Ruby and Rails. And again, I found the guides to be very helpful to get things running. One section that I found a bit jarring was the sidebar entitled, “Upgrading RubyGems on Linux.” This sidebar lists several methods for upgrading RubyGems for different versions of RubyGems and different linux distributions. The slightly odd part is that there is no explanation for which method is needed for which setup. Perhaps this is because there are so many linux distributions out there that listing them all would take another page (or more). Regardless, I found it odd that I was encouraged to keep trying the different methods until I found “the one that works for [me].”
The authors have also thoughtfully included a section discussing different editors and integrated development environments (IDE’s) that are available. When I first read this section in the third edition, I learned about a nice text editor for Windows that I didn’t know existed (E-TextEditor). This time around, I decided to stick with my linux text editor of choice. I briefly looked at using an IDE like RubyMine, but the Rails 3 version is still in beta (since Rails 3 is as well). I decided that sticking with a bare editor was fine for learning. I’m a command-line junkie anyway.
Overall, I found the installation guide to be plenty thorough. Perhaps that’s because I intended to work with all of the defaults (including sqlite for a database). Perhaps if I would have deviated more from the happy path, I would have had more of a problem. Then again, the authors have done a good job at pointing the reader to the necessary, external resources when they choose to step away from the default installation.
Chapter 2: Instant Gratification
In 13 pages, the reader is walked through creating a Hello, Rails application. This allows the reader to quickly experience the power and simplicity of Rails. Because the chapter accomplishes its goal very well, I don’t have much to mention. By the end of the chapter, the reader can have a very simple Rails application running in their development environment and handling requests. There are plenty of screen shots in just the right places, and I was never left with a question as to how to do something.
Chapter 3: The Architecture of Rails Applications
This chapter covers the basics of the Rails architecture. Models, Views, and Controllers are each discussed in turn. The basic request pipeline is described and illustrated. Additionally, there is a brief explanation of ActiveRecord. The chapter does a good job of teaching where different code concerns go within the architecture. The responsibilities of the Model, View, and Controller are covered well. Perhaps my reading of this chapter is skewed because I’ve worked with multiple MVC platforms already. However, I found that the topics were covered in sufficient (brief) detail. By the end of the chapter, the reader has a good idea of how the various files are laid out within a Rails application and what responsibilities are addressed by each of the major components of the system.
Chapter 4: Introduction to Ruby
This chapter is new for the fourth edition, and I found it to be a very welcome addition. Having never coded in Ruby before, I found this chapter to be quite informative. The authors assume that the reader knows nothing about Ruby. Since I am squarely in the target audience for this chapter, I can honestly say that I learned a great deal here. The authors have covered object-orientation, data types, logic, and structures.
The authors also cover a small set of Ruby idioms. I found this to be very helpful since the bulk of my programming experience is in static languages. The coverage of Ruby idioms is only slightly longer than a single page, but I’ve already found it useful.
So far, I’ve found this book to be a very enjoyable, informative read. I look forward to continuing on (and to posting some reviews).