Book Review: CakePHP Application Development

I was recently contacted by PACKT Publishing and asked to provide a review for CakePHP Application Development. Following is the review.

This Book Fell Short For Me

Dec 30, 2008 by Jason R. Leveille

★★☆☆☆

If it is of any consequence, I have been working with CakePHP for over a year now, and over that year I have worked on 5 CakePHP projects (of various sizes). Though there were parts of the book I liked, for both technical and non-technical reasons I wasn’t a fan of this book.

The Parts I Liked

The example driven approach taken by the authors provides newcomers to CakePHP with step-by-step instructions for working with Cake. Providing source code examples is often the best way to learn/teach a particular subject. Ahsanul and Anupom provided plenty of source code to look at. They also provided detailed feedback regarding what exactly is going on in their examples. Though I thought the feedback was verbose and redundant at times, I think newcomers to Cake would like the detailed explanation this book provides.

The Parts I Struggled With

Some of the major reasons why this book wasn’t for me have nothing to do with technical content. The writing style of the authors, as well as errors in grammar and code examples, made this a very difficult read for me (and I read the book from cover to cover). I also took issue with inconsistent code formatting (indentation and spacing of code). As I am reading a book and my reading flow is interrupted, I become frustrated with the text and distracted by the interruptions. In the case of this book, the interruptions served to divert my attention from the subject matter.

As far as technical content, this book does not have nearly as much to offer (nor will it be as up-to-date) as what you would find by visiting book.cakephp.org (and api.cakephp.org), even if you’re just looking for an introduction. Your best source of information for CakePHP will always be these two websites. That doesn’t mean that a CakePHP book couldn’t have value … on the contrary, I don’t care how good online documentation is (and Cakes is among the best for an open source project), there is no substitute for a good book. With the alternatives available though, a Cake book would have to shine. This book didn’t shine for me. One glaring example exists in the QuickWall demo application built towards the end of the book. The authors make use of the CakePHP minLength model validation rule. Frequently throughout the demo, in source code and in explanations, they refer to this rule as minLenght. This is, of course, a mistake, and it happens in multiple places. How could this mistake make it all the way to final publication? When I checked the online errata for this book, I found no mention of the error (I submitted an errata entry that may or may not be there when you read this). The minLength example represents a small piece of one part of the book, but it provides a window into what I saw as a clear lack of detailed polish throughout the book.

Other issues I had with this book include: 1) I understand that many books are going to talk about JavaScript and try to meet their quota for Web 2.0 buzzwords, however I believe that space would have been better filled with information about CakePHP behaviors (containable), plugins, internationalization/localization, configuration (Configure class), debugging, etc, etc; 2) If you are going to use the e (echo) shortcut, take the next step and also use the h shortcut to escape output where appropriate; 3) Often books give a false impression that using a framework such as this will bring you from concept to completion in no time at all. Although a full stack framework such as this will take care of many mundane development tasks, there will always be a substantial amount of work left to do, for example, after running cake and baking your models/views/controllers. Data needs to be filtered and escaped, granular access control and administrative backends need to be constructed, sql calls need to be vetted for efficiency, proper deployment processes need to be put in place, etc, etc.

Conclusion

No framework can be the Chia Pet of the development world - you can’t sprinkle on a little water and expect to have a plant with little effort in a short amount of time. I think that any indication otherwise is misleading. You’ll still have to work hard with Cake (application development takes time), but at least you’ll be working in the right direction. I thought the message of how easy development is with Cake was too strong in this book. Poor applications can be built with or without Cake in PHP. It is up to authors to provide at least a partial glimpse into best practices when developing with the topic they are writing about. I just didn’t think that happened here. With polish, attention to detail, and the inclusion of a wider range of CakePHP features, I think this book would have been a nice addition to your collection. Unfortuantely, for me it fell short.


4 Comments for "Book Review: CakePHP Application Development"

Comment 1 Zac - Gravatar Zac

Thanks for the review, Jason.

I'm curious if you have read the beginning Cake book from Apress and what you thought of that...

Tue, 30 Dec 2008 13:18:30 +0000 Link

Comment 2 leveille - Gravatar leveille

I haven't Zac, but maybe one day I will. In general, all the Apress books I've read (1 which I'm current reading) have been great books: Beginning Python, Pro JavaScript Techniques, Pro JavaScript Design Patterns, Pro PHP Security, and Pro C# 2005.

Tue, 30 Dec 2008 13:23:05 +0000 Link

Comment 3 Review: CakePHP Application Development - cakebaker - Gravatar Review: CakePHP Application Development - cakebaker

[...] Jason Leveille [...]

Wed, 31 Dec 2008 04:25:39 +0000 Link

Comment 4 Book Review: CakePHP Application Development | PseudoCoder.com - Gravatar Book Review: CakePHP Application Development | PseudoCoder.com

[...] how guy #497 of the Houston 500 felt. There isn’t much new to cover, as it has all been said before. I will say the grammar didn’t bother me, like it did most of the other reviewers, probably [...]

Thu, 15 Jan 2009 23:41:50 +0000 Link

Comments have been disabled for this post.