Book Review: Javascript: The Good Parts

First off, a confession--I've rewritten the first sentence of this post maybe a dozen times. (How's that for meta?) For one reason or another, I figured that writing about JavaScript would warrant some clever insight into the language. Some poetic tidbit that people could rally behind. The kind of voice that could shape a generation of empathetic web developers.

Something like:

Javascript is a language of alchemy, turning inconsistent behavior and design flaws into Web 2.0 gold.

Or maybe:

JavaScript is nothing short of quantum physics with its spooky action at a distance.

Before I decided to go all self-referential with my introduction, I had tentatively settled on something I think we can all agree with:

JavaScript is really, really weird.

As weird as it is, there are a lot of good reasons to actually learn JavaScript, and not just pretend it's some other language with C syntax. It takes a great deal of insight into this language to understand its true potential, and Douglas Crockford offers just this in his new book, "Javascript: The Good Parts." This offering from O'Reilly and Yahoo! sets itself apart from other JavaScript books in a lot of ways.

The first thing you'll notice is how thin this book is. Weighing in at around 100 pages and another 50 with appendices, it's a concise and remarkably pleasant read that you'll probably finish in a single sitting. Nonetheless, there is enough packed into this book to have you reading it through a few more times. Another rarity among programming books is its remarkable clarity and pleasant, patient tone. That said, this book is not for beginners (JavaScript probably isn't a great language to learn programming with anyway). By tailoring the book to people already familiar with programming fundamentals, Crockford is able to tease out the quirks that make JavaScript so confusing, and expose some of its hidden elegance.

The best parts of "The Good Parts" are definitely Chapters 4 and 5, which take a look at some of JavaScript's more unique aspect--functions as objects and prototypes. In Chapter 4, Crockford explains and implements an impressive set of language features like modules, function currying, and memoization, which make JavaScript start to feel closer to languages like Python, Haskell, or Lisp. Chapter 5 does a great job explaining the difference between classical and prototypical inheritance, and how to take advantage of prototypes in JavaScript.

If you're a developer looking to finally make sense of JavaScript, you'll find this book to be right up your alley. It's an enjoyable read that presents core programming concepts and won't waste your time on the marketing buzzwords that usually come with the territory. Do yourself a favor and check out Douglas Crockford's Javascript: The Good Parts, and forget everything you ever thought about this poor, misunderstood language.

Mattt Thompson
Yahoo! Developer Network