Book review: Practical CakePHP Projects

Published on and tagged with book  cakephp

In this article I’m going to have a (short) look at the third English CakePHP book, which has been published in December of the last year: Practical CakePHP Projects (or on Amazon) by Kai Chan and John Omokore.

It is a book I don’t like, because, in my opinion, it was not written with the reader in mind…

The authors show a lot of (not always well-written) code, but somehow they forgot what they wanted to teach. In the foreground are the “practical” examples and all the (unimportant) details of those examples, and not things you as a reader may want to learn like pagination, i18n, ACL, testing, etc., those topics are put into the background. And sometimes I really wished there would be more meat on the bone, for example in the chapter about testing. One simple unit test case (plus a hypothetical fixture) and a web test case is not much…

On the positive side is to mention the diversity of the examples, they range from a web service to custom tags.

But in the end I have to say the book doesn’t fulfill (at least for me) what is promised on the cover: “Learn how to create dynamic web sites with CakePHP by working through practical examples from the experts”.

Reviews by others:

PS: You can download the first chapter, “Cake Fundamentals”, from Apress’ website.

13 comments baked

  • Mike B

    I was considering picking this up, but now I may re-consider. It sounds like you are trying to say that the authors provide solutions to a lot of common problems but fail at providing background or perspective to the problems themselves.

    Or does it cover a lot of examples but just not the ones that are common amongst cake devs?

  • cakebaker

    @Mike: Thanks for your comment!

    Well, what I’m trying to say is that the authors usually show one example of how something could be used. Without providing much background about the used feature (e.g. in the section about i18n the i18n shell script is never mentioned). The focus is often on making the example applications work, and not on teaching the reader how to use those feature in his own applications.

    It’s probably best to look at this book at a local bookshop to see whether it contains what you are looking for…

  • CakePHP : signets remarquables du 08/01/2009 au 13/01/2009 | Cherry on the...

    […] Book review: Practical CakePHP Projects […]

  • Martin Westin

    page 7:
    “The controller should contain most of the business logic”

  • Steve Oliveira » Blog Archive » CakePHP books - Just another WordPress weblog (I’m fine with this tagline)

    […] Daniel Hofstetter has just recently reviewed Practical CakePHP Projects. Check it […]

  • cakebaker

    @Martin: ;-)

  • Watts

    I picked up this book, too, and I’m terribly annoyed with it. In addition to the problems you mentioned, the technical editing in it is terrible. In Chapter 2, for instance, it tells you about the ‘add_or_edit’ element for adding/editing posts, but it doesn’t actually give you that element. Listing 2-6 is for an add view that… doesn’t use the add_or_edit element. If you follow along with the text, you won’t be able to create the sample application.

    There are other typos I’ve caught, including in code. I bought the book in the hopes that it would teach me stuff I didn’t know — but I can recognize such grievous errors in the stuff I do know that I’m just not sure I can trust it to get things more complex right.

  • cakebaker

    @Watts: Yes, such things are annoying…

  • jamc

    Si tienes razón este libro nunca fue pensado en el lector. desde el primer ejemplo de e-commerce no se lo puede seguir.

    Aparte que como ya lo dijiste el tine mucho código “incorrecto”. ahora lo estoy leyendo pero me encuentro fustrado ya que pense que estaba mejor y lo peor es que no hay otro libro parecido.. Del otro lada cakePHP application development de Packt. Pub. me gusto mucho…

  • cakebaker

    @jamc: I’m not sure I understand your comment correctly (I had to use Google translate as I don’t speak Spanish), but right now I don’t recommend any CakePHP book as all (English) books are outdated… Probably the best thing you can do to learn CakePHp is to use the API and the cookbook, and to ask questions in the IRC channel or the Google group (there is also a Spanish group)

  • JJJ

    There is no source code for the first chapter – a place where you would imagine a good start is required.

    Elsewhere code is just thrown out here and there and there is very poor explaining as for what goes where.

  • plainsdude

    The book is pretty terrible. I mean the chapter 2 example doesn’t even work (watts covered this – add_or_edit.ctp ??). Pretty terrible way to introduce someone new to CakePHP.

  • cakebaker

    @JJJ: Yes, the code for the first chapter is missing, though I’m not sure whether it would be that helpful, as there is no coherent example in that chapter.

    @plainsdude: Yes, I agree, and I wouldn’t recommend this book for people who are new to CakePHP.

Bake a comment




(for code please use <code>...</code> [no escaping necessary])

© daniel hofstetter. Licensed under a Creative Commons License