Code Samples in Pragmatic Ajax

Mark Haliday raised an interesting question in the comments of my post announcing Pragmatic Ajax. His question: are most of the code samples in the book Java? Without a scientific analysis, here's my best guess as to how the samples break down across the book:

  • 60% JavaScript
  • 15% Java
  • 9% Ruby
  • 8% .NET
  • 8% PHP

The extra space devoted to Java is largely due to the section of the Google Maps chapter devoted to carving up the SVG map which was done in Java, but has little or nothing to do with Ajax or Web 2.0. We just thought it was interesting.

No, in fact, the majority of the book is about JavaScript: how it works, how the various libraries for Ajax work with JavaScript, etc. We tried to devote equal time to integration with the four major web development platforms (Java, .NET, PHP, Ruby on Rails). We did that for good reason: I can write a pretty cool Ajax application with nothing but HTML and JavaScript.

Hope that helps clarify the purpose and nature of the book. Thanks for the question, Mark!

Get In Touch