At the Forge - Book Roundup
Remember the Web? You know, that combination of Internet technologies that will make paper obsolete? Well, it's true that many newspaper and magazine publishers are hurting, and that many people (including me) now read things on-line that we previously read on paper. And, for Web developers in particular, the Web provides a treasure trove of information, ranging from blogs and articles to forums and IRC channels.
Based on the flurry of content that is available on-line, and the reported death of print media, you might think that the number and quality of Web-related books also has declined in recent years. From what I can tell, however, the opposite is true. I continue to see a large number of high-quality books from a number of different publishers, on topics that are relevant and interesting. Even better, I have found many of these books to be useful in my day-to-day work, giving me perspective on technologies I already knew and teaching me many things that I hadn't previously known.
I have been working with Ruby on Rails for several years now and continue to see it as a breath of fresh air. After years in which I had to work directly with a database, writing explicit SQL queries, it's a delight to be able to think about things at the object level, rather than at the row-and-column level. Admittedly, some performance issues exist with Rails, but when you want to create a Web application quickly and easily, nothing else comes close. (Actually, that's not exactly true. If I hadn't been smitten by Rails, I probably would be using Django today. And, there are several Rails-like application frameworks out there, including CakePHP and Catalyst, both of which have their fans.)
The now-classic, standard text for beginning Rails programmers is the second edition of Agile Web Development with Ruby on Rails, written by Dave Thomas and David Heinemeier Hansson, and published by the Pragmatic Programmers (ISBN 978-0977616633). This edition is due to be superseded by a third edition by the time you read this column, so some of my comments might not be relevant anymore. But, I generally have had mixed feelings about the first and second editions of this book. On the one hand, it successfully got me excited about Rails and provided me with a useful introduction back when I was first starting with it. At the same time, I kept searching for an introductory book with a slightly different style that I could recommend to beginning Rails developers.
One particularly strong introductory Rails book is Simply Rails 2, by Patrick Lenz (ISBN 978-0980455205). This book introduces a large number of key Rails features, including the MVC architecture, associations, testing, Ajax, some elements of Prototype and script.aculo.us, and even debugging with tools, such as ruby-debug. Because Lenz aims to cover less ground in his book, he manages to make a more effective tutorial than Agile Web Development with Ruby on Rails. Frequently interspersed code samples, screenshots and diagrams make this a particularly accessible book.
Once you have finished with Simply Rails 2, you will need a reference guide that describes the Rails architecture in greater depth, with a more comprehensive list of features. Obie Fernandez's book, The Rails Way (ISBN 978-0321445612), is an excellent, detailed and thick resource, although I think it mentions (and emphasizes) routes and RESTful architecture a bit early for many newcomers. That's probably fine, given that this book is not meant to be a tutorial, but rather a reference and advanced guide. So, although I strongly recommend this book and use it several times a week as a reference for my own work, it doesn't do the trick as an introduction or tutorial.
Good complements to The Rails Way, and to one another, are three similarly named books from two different publishers: Rails Cookbook, by Rob Orsini (ISBN 978-0596527310); Rails Recipes, by Chad Fowler (ISBN 978-0977616602); and Advanced Rails Recipes, by Mike Clark (ISBN 978-0978739225). Each of these books follows the now-standard format of having many short chapters, each addressing a common problem developers might encounter. Each of these books contains multiple recipes that have given me ideas, and even when I haven't used the recipe directly, I have found them to be useful food for thought. I'm also not sure whether the third book is truly as advanced as its title would indicate.
Finally, the book Deploying Rails Applications, by Ezra Zygmuntowicz, Bruce Tate and Clinton Begin (ISBN 978-0978739201), has a great deal of practical advice about taking a Rails application and making it available to the general public. The authors guide you through using version control (with Subversion), configuring one or more production servers, deploying with Capistrano and identifying bottlenecks. The book assumes you are using MySQL, which means people who use PostgreSQL (like me) can ignore some of the advice. There also is a chapter on Windows deployment that I expect most readers of this column can ignore.
The authors assume you want to deploy your application with a combination of Mongrel (for dynamic, Ruby-generated content) and nginx (for static content), while ignoring such possibilities as Phusion (aka mod_rails), an Apache module that some sites have been using with great success. Then again, Zygmuntowicz is the founder of Engine Yard, a Rails hosting company that has been enjoying great success, so it might be wise to follow his lead. Regardless of the specific implementation choices the authors suggest, this book helps put each aspect of Rails deployment into perspective, and it's good reading for people who plan to make their applications public.
Thus, I was pleased to discover Practical Prototype and script.aculo.us, by Andrew Dupont (ISBN 978-1590599198), which is one of the best programming books I have read in the last few months. It introduces Prototype (and its companion GUI toolkit, script.aculo.us) with on-target, practical and illuminating examples—along with a sense of humor I found refreshing, without getting in the way.
Modern Web pages are styled with cascading stylesheets (CSS), a technology that is quite simple to understand in theory, but it can become complicated when it comes to execution. One book that seems to offer a gentle introduction to CSS is The CSS Anthology, by Rachel Andrew (ISBN 978-0975841983). This book is a cross between a tutorial and a cookbook, allowing you to learn CSS in the context of bite-sized lessons and ideas.
Finally, I have found The Ultimate CSS Reference, by Tommy Olsson and Paul O'Brien (ISBN 978-0-980285857), to be a useful list of CSS selectors, properties and values. Especially useful is the table indicating the degree to which each browser complies with the CSS standard for each property. The information in this book is available elsewhere, but it is particularly handy if I am not connected to the Internet (which, I'm ashamed to admit, is sometimes the case), or if I just want to skim through a number of related items. My main complaint with this book is its lack of an index, and although I realize you can read and search much of it on-line, adding 5–10 pages of index would have changed this from a good book into an excellent one.
Facebook, LinkedIn and other social-networking sites are all the rage, and I even have looked at some aspects of these sites in this column.
If you're interested in creating your own social-networking site, two books might be of interest to you. The first, RailsSpace, written by Michael Hartl and Aurelius Prochazka (ISBN 978-0321480798), describes how to create a simple social site with users, friends and Ajax-based blogs. The source code to RailsSpace has been made available, so you can use the code to build your own, real-world site, rather than merely go through the tutorials. Even better, one of the authors (Hartl) has founded an open-source project called Insoshi (www.insoshi.com), which offers a downloadable framework for creating social networking sites.
A second book on the subject, Practical Rails Social Networking Sites, by Alan Bradburne (ISBN 978-1590598412), is a bit more ambitious in the projects it aims to do, showing examples not only of users and friendship links, but also of e-mail, discussion forums, a photo gallery, user-created themes and a mobile interface. The code from this book is used to power the RailsCoders site (www.railscoders.net), and it similarly can be downloaded and used to power a real-world site.
No matter what toolkit you use, or whether you decide to create a social site on your own, you should consider the wider implications of what you are doing. Designing for the Social Web, by Joshua Porter (ISBN 978-0321534927), is one of the most interesting books I've read on the subject to date, and it's full of practical advice on how people participate in a site. A slightly less practical, but no less interesting book is Clay Shirky's Here Comes Everybody (ISBN 978-1594201530). His analysis of the social Web, and how groups are now collaborating before they fully know each other and define themselves, is full of interesting anecdotes, but also cautionary tales about what the designers of such sites should consider when deploying.
Perhaps the printing press is going the way of the dodo bird. But for the time being, there are plenty of books that I find not only useful and interesting, but also essential as I go about my daily life as a developer and consultant. If you have read a particularly interesting and useful book you think I should know about, please send me e-mail. I am always happy to learn about new, high-quality books, and if it turns out to be particularly useful, I'll be happy to share it with other readers of this column.
Reuven M. Lerner, a longtime Web/database developer and consultant, is a PhD candidate in learning sciences at Northwestern University, studying on-line learning communities. He recently returned (with his wife and three children) to their home in Modi'in, Israel, after four years in the Chicago area.