The Definitive Guide to Catalyst: Writing Extensible, Scalable and Maintainable Perl–Based Web Applications
Kieren Diment, Matt Trout
I've used Perl for about ten years, and have experience with all of the "pre-Catalyst" frameworks and helpers (from CGI.pm to CGI::Application to dalliances with writing my own and trying Jifty). I've also used Rails and read several books on it (most of which are disappointments).
Unfortunately, I found this guide a disappointment as well. Most of the book seems to be structured around a few "examples," the largest of which is a translation app from English into "Lolcat." The problem with such an app as an example is that it could readily be done in a dead-simple, several-line CGI script (hell, even a one-liner could probably do it), so it requires a certain suspension of disbelief that one should be using stashes, chained dispatch methods, templates, and the like. Why not a normal CRUD type app as an example? Boring, yes, but to-the-point and more likely to be illustrative of the tools and their best applications.
The conversational "flow" of the book is distracting, as well. I understand that a more tabular or outlined form for making specific information easier to find could render it hard to read "straight through" as a book. But the sheer volume of information, and diversity of scenarios, make it unlikely that anyone will read it straight through and make equal use of all parts. Far better to organize the content more rigorously by function -- for example, the best and best-structured chapter by far is the chapter on dispatch (it gets to borrow for its prose structure from the flow chart on page 168. Less in-depth meanderings into such adjuncts as DBIx::Class and Moose, but more on how (if at all) such outside modules must interface / play nice with the Catalyst core. A chapter on errors. A chapter on logging. A chapter on templating.
The index is a mess and lazily put together. Under "log", only one entry: "Logging, in Catalyst, 7." (Are you serious? who wrote that index entry? Logging, comma, IN CATALYST?!? SERIOUSLY??) For "error:" "error handling code, changing to output errors to the log, 104-105." Nothing for "exception" (fair enough, as Perl properly has none), but under Perl's equivalent, "die:" "die, using for error handling, 156." WTF? Finding these three sections shouldn't be an Easter-egg hunt. WTF would be wrong with:
error
using "die" ... 156
logging ... 104-105
see also *log*
log ... 7
errors ... 104-105
I'm rooting for Matt & co., and I'm a fan of Catalyst. But this book needs a reworking for its next edition, and it needs an editor (the typography, too, is underwhelming). It's not that the team that wrote this isn't smart enough, or that they don't know the subject well enough. It's merely that they need to structure, structure, structure, and clarify, clarify, clarify. Looking forward to second edition, guys.
Ссылка удалена правообладателем
----
The book removed at the request of the copyright holder.