Ajax and PHP: Building Modern Web Applications, 2nd Ed. (Review)

Photo by Mike Johnston - http://www.flickr.com/photos/mikejsolutions/3078513728/

Just found this long overdue review of Ajax and PHP: Building Modern Web Applications – Second Edition sitting in a drafts folder – looks like I never published it. (Full disclosure – Packt sent me a review copy).

This is the successor to the wildly popular Ajax and PHP: Building Responsive Web Applications, which came out back in 2005. The authors of this edition are Bogdan Brinzarea-Iamandi, Christian Darie, and Audra Hendrix. (Brinzarea-Iamandi was also one of the authors of the first edition).

This is a really useful book for the right audience, covering:

  • Simple PHP, including connecting to MySQL
  • Basic MySQL and relational databases, including some basic queries
  • JavaScript, including a discussion of object oriented JavaScript and the benefits thereof
  • JQuery, which is rapidly becoming the dominant JavaScript framework (and is now included in applications like WordPress and Drupal)
  • Debugging approaches and techniques, including profiling
  • Cross-site scripting exploits and how to mitigate them
  • Cross-domain ajax calls using server proxies, Flash, iFrames, and JSONP

In other words, although it does use Ajax as the ostensible subject at hand, in order to explain how Ajax works in the context of real web applications, the book ends up covering a wide ground in a rapid fashion. The book culminates in two practical examples: a chat application and a data grid, both using JQuery, PHP, and MySQL together in familiar patterns.

More experienced readers might be frustrated by how quickly the book moves through these topics. Trying to cover, for example, “Object oriented programming concepts” in four pages requires a very concise definition and not a huge set of examples or illustrative excercises. The book also doesn’t stray outside the LAMP stack, to talk about Ajax in Microsoft.NET, Java, Python, or Ruby applications, and doesn’t address other relational databases, let alone the whole NoSQL movement. There’s also no HTML5 discussion, but you have to remember the book was published in December of 2009.

One decision which struck me as odd, but may be a reflection of my personal experience, is that they cover (in an appendix) setting up XAMPP for Windows and Linux, but for Mac OS they send you to a web tutorial. Have you been to a web dev conference lately and seen how prevalent the Apple logo is? I get why you’d want to focus in and not try to cover all the cases, but I think based on my experience I might out Mac instructions first.

But coming to this book expecting detailed architectural discussions across multiple platforms is looking for wisdom in all the wrong places. Peruse the table of contents at the PACKT site and see which category you (or whomever you’re buying the book for) might fit in.