Dr. Dobb's Journal May 2003
My, how the time flies. As I write this, I'm about to turn 40, it's been 30 years since the last man walked on the moon, and I've given away two copies of David Cross's Data Munging with Perl without ever telling the world at large what a good book it is. It's too late to do anything about the first two facts, but I can certainly correct the third.
The blurb on the back of Data Munging with Perl says, "This book shows you how to process data productively with Perl," and that is exactly what it does. The first chapter looks at where data comes from, and why you'd want to transform it. Chapters 2 and 3 then introduce a handful of solid design principles and some useful Perl idioms. The remainder of the book is devoted to parsing, processing, and outputting data in a wide variety of formats: binary, free-form text, fixed- and variable-length records, and XML.
Perl obviously figures prominently in the book and, in fact, Cross's examples are some of the cleanest, clearest Perl I've ever read. However, the book is not really about the ins and outs of Perl. Instead, it is about data, and patterns that occur repeatedly when you are processing data. I write Python differently having read this book, and expect that the average Java or C# programmer would learn a lot from it as well. It is well written, informative, thought provoking, and will be as relevant five years from now as it is today. In short, what are you waiting for? Go and buy a copy.
Clayton Donley's LDAP Programming, Management, and Integration is another good book that coincidentally happens to use a lot of Perl. LDAP, which stands for "Lightweight Directory Access Protocol," is popular for storing information about people. It is not a database per se, but rather a set of rules for querying databases to find phone numbers, personalization preferences, security privileges, and the like.
Donley's book is divided into three parts. The first (Chapters 1-5) is conceptual: What is LDAP? How do namespaces and search criteria work? What is the Directory Services Markup Languages (DSML)? Part II (Chapters 6-10) is about driving LDAP: writing queries, updating and synchronizing information, and so on. The third and final part then switches from Perl to Java, and looks at JNDI, DSML, and using directories to back up authentication and authorization services. Throughout, the writing is conversational without being chatty, and the examples are well chosen and well written.
The group I work with in Toronto has been writing LDAP code in C++, Java, and Perl for the last three and a half years. In that time, I have flipped through just about every book out there on LDAP, and read three from cover to cover. Donley's is the first one I would recommend without reservation. The author clearly knows his material, and has organized it in a logical way.
Next is Struts in Action, by Ted Husted et al. This book is as big as the other two put together, but don't let that scare you away. Its subject, Struts, has been developed under the auspices of the Apache Foundation. It brings together Java Server Pages, Java servlets, and other Java-based technologies to create a reusable framework for building web apps. Like modern GUI toolkits, Struts uses the Model-View-Controller paradigm to separate the data being operated on (the model) from its presentation (the view) and the workflow logic (the controller). And, like any other framework, Struts also encourages developers to think about problems in ways that have proven effective in the past.
How to think about using Struts is as important a part of this book as the mechanics of configuring and programming it. Methodically, a chapter at a time. Husted and his coauthors describe each major component of Struts, and show how best to use or extend it. I did lose my way in the depth-first exposition occasionally, but this certainly wasn't the fault of the writinglike Cross's and Donley's books, it is very clear. While the reference sections and API listings will undoubtedly go stale as Struts evolves, the insights will not.
The clarity of Struts in Action is even more appealing when the book is compared to Sue Spielman's The Struts Framework, or James Goodwill's Mastering Jakarta Struts. I found Spielman's book too shallow to be helpful, and occasionally became dizzy as new concepts whizzed by. Mastering Jakarta Struts covered things in more detail, but read as though the author had transcribed a series of impromptu chalkboard talks, and then gone back and tidied them up.
One final aspect of the three books published by Manning that deserves mention is the quality of their editing and production. The only typos I spotted were misindented lines of code in examples, and even those were rare. All three indices are helpful and accurate, and the layouts are crisp and readable.
DDJ