Relevance Review #4: Head Rush Ajax
Head Rush Ajax, from O'Reilly, by Brett McLaughlin.
Quick summary:Fantastic introduction to the basics of Ajax if you can stand the format. Have one copy for your team and hand it to the new programmers during their orientation.
The Head Rush (and Head First) series are wildly popular. I can't argue that. What I can't figure out, really, is why. I'll let my wife explain it for me. Honey?
My wife: Is that the next book you are reviewing? You're only on page 3. You're going to be up a while.
Me: It sure is. Head Rush Ajax. Nifty title, no?
My wife: I guess. Hey, tell them to get rid of the picture of that goofy guy over in the margin.
Me: Uhhhhh....(flips through rest of book really fast to demonstrate goofy guy on every page)
My wife: Don't people find that insulting?
Me: Uhhhhh........(doing best Butthead impersonation)
Yes, this is an homage to the Head Rush conversational style...its like a meta-review, see?
So, these series use informal language, tons and tons of pictures, lots of diagrams, and every font in the I-just-discovered-the-font-menu-in-Word-2003 pantheon. They explain this up front by saying that your brain really only pays attention to tigers. And Comic Sans, apparently. And, honestly, I can't argue with Brett or Kathy Sierra on this: they've sold a ton of books, and people seem to dig it. Let's just say that I could have used one less picture of the Project: Chaos guy who looks like a well-armed Devo fan.
I actually love the technical content here. Its a perfect primer for Ajax. They cover:
- creating XMLHttpRequest objects across all browsers
- Invoking them asynchronously and synchronously (with bonus material clearly delineating the two)
- Harvesting the results while checking for readystate and status codes
- Utilizing XML as the request/response payload
- Extensive DOM navigation techniques
- JSON vs. XML for data transmission
- Security issues like SQL injection and rogue
It is the perfect beginner's mix of how to get stuff done without screwing up. In addition, the code is robust, and the descriptions are filled with helpful tips about the kinds of status codes you might expect, how to defeat IE URL caching, and little stuff that drives the beginning programmer crazy because they are hard to Google.
Unfortunately, because of the format, it takes a whopping 395 pages to get through that list, while another book would probably do it in under 50. Which is why, having read it now, I'll not crack its glossy, shiny, brightly colored cover again, much as I enjoyed the author's writing style, wit, and dedication to his craft.
Probably the only other downside to this book is that all the server code is PHP. There is nary a mention of other server-side possibilities, and therefore no examples, either. Which means the text doesn't even mention the possibility of other kinds of Ajax apps (using remoting, or even code-centric Ajax). They also, strangely, don't mention SAJAX or XOAD, the two major PHP Ajax toolkits. If you're going to do an entire book on PHP and Ajax, and then have an appendix listing Ajax toolkits, it seems appropriate to mention the shaded part of the Venn diagram.