Pro Drupal Development, by John VanDyk and Matt Westgate (Apress, 2007) is the first book aimed specifically at Drupal developers. Until now, developers have had to refer to Drupal's vast and rich online documentation, which encompasses the "Developing for Drupal" section of the drupal.org Handbook, the documentation at api.drupal.org (which would be much improved if users could post comments, php.net-style), and the invaluable code examples and explanations of how Drupal works under the hood that make grazing the various support forums for hours worthwhile. The Drupal documentation team is doing a commendable job of keeping the technial and general end-user documentation in shape but that is an endless and thankless task. Supplementing the information available within the drupal.org domain are clusters of useful developer-oriented documentation and articles, typified by the resources on the Lullabot website (who Matt Westgate works for). Pro Drupal Development brings a high level of cohesion and clarity to the often frustrating variety of existing Drupal technical documentation and will prove to be an indispensable reference and how-to for anyone who wants to extend Drupal.
Drupal module development and theming are based on overriding core functions, not modifying Drupal code. Pro Drupal Development makes that sometimes forgotten principle clear:
Drupal is designed to be customized, but customization is done by overriding the core or by adding modules, not by modifying the code in the core. [page 1]
and
[...] you don’t need to (nor should you) edit the HTML within module files to change the look and feel of your site. By doing that, you’ve just created your own proprietary content management system, and have thus lost one the biggest advantages of using a community supported open source software system to begin with. Override, don’t change! [page 107]
These two quotations encapsulate the zen of Drupal, and Pro Drupal Development contains chapters on everything developers need to know to live by this philosophy. Two chapters deal specifically with writing modules and one with creating themes, and the rest either provide detailed coverage of topics directly related to module development, such as the Drupal menu system and the ubiquitous node and user objects, or provide information that is more generally applicable to Drupal development, such as writing secure code in the Drupal environment and performance tuning. The text is presented in a refreshing balance of prose, code examples, screensnaps, flowcharts, block diagrams, and tables, and the back-of-the-book index, which is over 35 pages long, is both detailed and user friendly. Pro Drupal Development only covers Drupal version 5.x, although much of its content is applicable to the other currently-supported version, 4.7.6. The Apress website provides a table of contents for the book (as well as code examples and a sample chapter, "Theming System").
Overall, this book brings together in a very nice 428-page package the most essential developer-oriented documentation that is also available, in one form or another, on the drupal websites or elsewhere. Having the hard copy and the PDF version of the book (available for an exta $10 from Apress) will save Drupal hackers countless hours of time. Chapters that stand out include those on the Form API, jQuery (the JavaScript library bundled with Drupal), localization, and theming. The chapter on writing secure code is also worth mentioning, since even though this topic is covered in some detail at the drupal.org site, seeing yet another explanation of the security mechanisms Drupal provides, such as its "t()" function, that supplement safe PHP programming practices is very useful.
Since the book is so good in general, a few deficiencies stand out:
Apart from these gaps, a chapter on the must-have content-management modules cck, views, and contemplate would be useful since these three groups of modules add vastly to what is an already awesomely sophisticated content management system. Many helper modules are sprouting up around cck and views in particular, and a chapter on this topic may inspire developers to help extend Drupal in those dimensions, and to explain the internals of these complex but essential modules.
In general, Pro Drupal Development is well organized, clearly written, carefully edited, and a very valuable resource for Drupal hackers. I would characterize it as a nicely packaged, value-added "best of" collection from the vast and loosely coupled online documentation that you need to explore and make sense of on your own if you are developing Drupal modules. Calling it a collection suggests that VanDyk and Westgate are simply compiling other people's content, which is not the case -- when using their book I don't get the nagging sense that I've paid for a hard copy of a website. Their book is actually much more useful than the documentation available on the web because it trims out the information you don't need and presents the information you do need effectively. You should consider buying it if you are starting to develop Drupal modules or already have developed a few, even if it lacks a few things that would make it a complete API docs/cookbook/howto. Buy it from http://www.drupalbook.com/ and the Drupal Association gets $5.
Comments
Another review
Another review of this book is available at http://books.slashdot.org/books/07/06/06/1352210.shtml
Post new comment