Professional JavaScript for Web Developers Review

Nicholas, I apologize for taking such a long time to write a review of your book: Professional JavaScript for Web Developers, 2nd Edition.

I’ve long said that JavaScript is a simple and complex language. Its simplicity allows even the most novice front-end developer to build a working browser application. However, its complexity is what keeps most novices, and even experienced front-end developers, from understanding the language and tapping into the really cool stuff JavaScript allows them to do. Zakas’ well-written book, Professional JavaScript for Web Developers, 2nd Edition, thoroughly explains complex JavaScript concepts and provides the reader a solid foundation on which to build more robust front-end applications.

The book first covers the more basic concepts of the language: a detailed history of the language, the fundamentals of any modern programming language (such as operators, control structures, and functions), variables, scope, memory-management, and the native reference types of JavaScript. It then naturally flows into object-oriented programming with JavaScript. This particular chapter is a gem, as Zakas details JavaScript’s many object creation patterns and prototype chaining. Zakas also explains the caveats to prototype chaining and discusses other inheritance techniques developers use to solve issues with prototypes. The book then discusses topics associated with anonymous functions, such as recursion, closures, and private variables.

After a complete analysis of the JavaScript language, Zakas leads the reader to the browser - the platform of the front-end developer – starting with the Browser Object Model. He then moves to client detection where he covers the different types of detection and even offers a complete client detection script. The next two chapters cover the Document Object Model (DOM), the objects provided by the DOM, and how to manipulate those objects. He covers DOM Level 1 first, and then discusses the changes Level 2 and 3 bring to the specification.

Zakas then spends 67 pages on Events, the heftiest chapter in the book. But that is for a good reason, as events are an integral part of front-end development. He covers event bubbling and capturing, the DOM and IE event models (and provides cross-browser event object), mouse and keyboard events, HTML events, mobile Safari events, simulating events, and memory and performance issues related to events and event handlers.

From there, the book covers forms (and how to script them), error handling and debugging (showcasing IE8’s Developer Tools and Firebug), XML scripting (including E4X), Ajax and JSON, advanced techniques (scope safe constructors, advance function techniques, advanced timers, custom events, and drag and drop), client storage (cookies, IE’s user data, and DOM Storage), best practices (a must read chapter for writing more maintainable and efficient code), and future APIs and versions of JavaScript.

Nicholas C. Zakas is a genius. I don’t say that because he’s a friend or a co-author. I say it because he thoroughly explains a complex language and teaches you how to use it effectively. I said it about the first edition, and I’ll say it about the second: this is the best JavaScript book you will find. It is well thought out, well planned, and very informative.

8/28/2009 11:28:54 AM | Tags: Books, JavaScript
© 2008 Jeremy McPeak