Book Reviews

Book Review: Building Dynamic Web 2.0 Websites with Ruby on Rails

Massive interest in Ruby on Rails over the past few years was quickly mirrored in book sales. Early entrants like the (near definitive) Agile Web Development with Ruby on Rails were break away hits in a world that usually sees modest sales of each title. It’s not surprising a lot of people wanted to get a share of that market, and the range of Ruby and Rails titles has exploded, with an unsurprising dip in average quality.

This latest title from Packt sits somewhere very low down the quality scale. An unfocussed volume, it purports to introduce the ruby language and show how to get up and running with a simple buzzword-laden Rails application, but does a distinctly inadequate job on both counts. Any moderately experienced rubyist would worry at seeing code like:

class Tale
  @author
  @genre
  @tale_body
end

recommended as the way to define a class with three attributes, rather than the more succinct, idiomatic and functional:

class Tale
  attr_accessor :author, :genre, :tale_body
end

(For those unfamiliar with ruby, the former will define attributes but not accessors for them. The latter will define the attributes and its accessors and is the recommended approach for public attributes)

That example occurs early on, and as the book progresses it is hard to shake the sense that the author isn’t sufficiently familiar with the idioms and best practices of the Ruby and Rails communities to be introducing either the language or the framework. When working with a framework as dependent on conventions and opinions as Rails, a failure to grasp the idioms is a serious problem.

It would be hard to recommend this book even if there weren’t many superior titles available. Newcomers to Ruby and/or Rails would be far better with any of several alternatives. Beyond that, while packt have published a number of excellent titles, the publication of this book should be taken as a reminder that there is no consistent quality control over the books they publish and buyers should research carefully before buying one.

Disclaimer: I was sent a copy of this book for review by the publisher. You can find it at packt, amazon US, amazon UK and all sorts of other places.

Book Review: Refactoring HTML

Despite years of progress by web standards advocates, and a significant improvement in the quality of the HTML on the web, many of us still end up grappling with outmoded, broken HTML on a regular basis. When confronted with a large site filled with broken pages it can be hard to know where to start. Elliotte Rusty Harold’s Refactoring HTML offers a step by step recipe book for migrating such sites to clean, semantic code.

Harold’s is a well known name in the XML world, and that background shows through in how he approaches the book. While a general audience will probably find useful content, the reader needs to be prepared for a series of command-line and Java-based examples. Tools like tidy are featured prominently, as is the use of regular expressions to seek out broken code to fix and, in the music-to-my-ears category, automated testing.

If you’re equipped to do so, following these steps will lead to much cleaner, more manageable sites, but I found myself wondering how many of those comfortable with command line tools and regular expressions are in the market for a book like this.

In general I suspect the key audience for this will be IT departments inside large organisations tasked with refreshing or extending an intranet. For those developers, who maybe don’t spend much of their time working with HTML and like the idea of using scripting tools similar to those in their regular workflow, this book’s worth a look. If you’re already familiar with current trends in web development, then there are probably other ways of picking up on the scattering of techniques that might be new to you.

Disclaimer: I was sent a copy of this book for review by the publisher. You can find it at amazon US, amazon UK and all sorts of other places.

Book Review: Learning Website Development with Django

Reviewing The Definitive Guide To Django a few months ago I noted that the key place that book lacked was in examples. As befits the work of the creators of a framework, it did very well at explaining the underlying philosophies and working through all manner of implementation details, but it wasn’t the book for those who just want to dive in and build something. If that’s how you like to use technical books, then Learning Website Development With Django may be more what you’re looking for.

Following the iterative development of a delicious/digg hybrid social bookmarking application, Ayman Hourieh’s book moves quickly through a range of Django features, from setting up your initial models, and using the built in user and admin sections, to supporting AJAX with jQuery, speeding up your app with caching and (briefly) writing automated tests. The pace is fairly measured and Ayman Hourieh does a good job of explaining what’s going on at each step. An experienced web developer should find most of the information they need to get up and running with django, ready to get to work on their own apps.

Perhaps appropriately, where this book is lacking is in explaining how the different parts of the framework fit together. There’s plenty you can pick up by inference, but there are no detailed explanations of, say, the routing system that maps URLs to code. This book’s weaknesses are the former volumes strengths, and while you’ll find much repeated between them a combination of the two is likely to be a good way to get a fully rounded sense of what django is and how you can use it.

Disclaimer: I was sent a copy of this book for review by the publisher. You can find it at packt, amazon US, amazon UK and all sorts of other places.

Book Review: Building Powerful and Robust Websites with Drupal 6

An update to David Mercer’s now two year old Drupal: Creating Blogs, Forums, Portals and Community Websites, this version has been revised for the CMS’ latest version and guides the user through from setting up a development environment and installing drupal through to building custom themes and deploying a fully built site.

The book is designed to be read sequentially and assumes very little prior Drupal knowledge, though a little familiarity with the interface would be helpful, and a lot of willingness to explore and experiment are going to be necessary for complete newcomers. The first few chapters–focussed on explaining the benefits of using drupal and guide the user through the initial setup–are a little clunky and may deter those not comfortable with installing databases and scripting languages. The style improves as the book progresses and Mercer covers his topics well, with a considerably better structure than several Packt publications I’ve seen lately. (sadly the book retains Packt’s )

Some of those topics are fairly complex and it might have been good to have a few more directions for exploring the power of taxonomies and getting to grip with best practices in designing them. Given the range of documentation (on blogs and elsewhere) available online, more references to resources outside the book would have been a useful addition. But the fact that Mercer takes users beyond the very basics is to his credit, and it’s very good to see coverage of jquery, CCK, caching, and other topics that are key to recent versions of drupal but which could easily have been glossed over.

This is not a book for the seasoned developer coming from another platform or for those who have already have ample drupal experience (others have that covered) and it’s not really the “user manual” I’d like to find to hand on to drupal-using clients. But for those with an itch to build their own site and a sense that drupal might be the right tool, this volume is well worth a look.

Disclaimer: I was sent a copy of this book for review by the publisher. You can find it at packt, amazon US, amazon UK and all sorts of other places.

Book Review: Practical Reporting with Ruby and Rails

Practical Reporting with Ruby and Rails is primarily a book about the presentation of reports. Having gone in expecting a mixture of presentation and production techniques I was a little surprised to find that the vast majority of the reader’s time is spent looking at various GUI and graphing toolkits, export to MS Office and the like, and there’s not much space given to managing large volumes of data, warehousing, and other such topics.

That’s not a criticism of the book so much as a caution to potential readers. After a little time spent looking at ActiveRecord, particularly focussing on using its calculation methods to save processor time, David Berube provides a pretty thorough coverage of a variety of ways to present reports. A few options for delivering data as PDFs, through a GUI, or directly into office are offered and a straightforward walkthrough is provided for each. The Rails content is minimal, and while the sample code could do with some refactoring and there’d be a case for using something more lightweight like merb it does the job.

But I must confess to being a little disappointed that there wasn’t more time spent on the data processing side of the equation. Having been building a lot of graphs lately and needing to write some new reporting code in the near future it was helpful to have some analysis of tools I might use, but I never felt like the book ever really dove into the complexities of reporting. There’s space in a book of this sort for serious consideration of both data processing and of visualisation techniques, but neither is really offered. Each chapter simply answers a very tightly defined request rather than delving into the full problem domain, and that feels like a missed opportunity.

If you’re evaluating output options for your ruby application’s reporting layer, this may be a handy book to have. It’ll provide you with a sense of what tools are appropriate for which problems and more detailed sample code than is easily found on the web. But if you’re looking to really grapple with reporting and visualisation you might be better off seeking out a good SQL reference and some of Tufte’s books.

Disclaimer: I was sent a copy of this book for review by the publisher. You can find it at apress, amazon US, amazon UK and all sorts of other places.