JavaScript: The Good Parts

Title: JavaScript: The Good Parts
Author: Douglas Crockford
Year: 2008
For: Intermediate JavaScript programmers or those switching to JavaScript from another language.

Douglas Crockford has been in the computer industry for a good amount of time. He’s an expert in the JavaScript world, popularized JSON, and lead JavaScript development at Yahoo! and Paypal. If you look up pictures of Crockford, he will invariably have that distant face of people who are thinking of things too complex to share with anyone around them.

He is, and has been for some time, an expert in the field of JavaScript and this is both the book’s greatest attribute and greatest fault. The author writes as though he is writing a script, practicing concision with little repetition. So even if this book is often offered to people beginning their trek into the world of JavaScript, I would recommend this book as a second book for those who are new in programming. Crockford covers the basics of the language, but at such a speed that beginners will quickly find themselves lost.

The Content

Though one of the smaller books one could find on the subject, Crockford tries to cover as much as possible of the language, obviously giving preference to the titular “Good Parts” but also giving a cursory glance at the “Awful” and “Bad” parts in their respective appendices. However while this book mentions most of the fundamentals of JavaScripts, this book is more about the style of JavaScript and what makes JavaScript unique compared to other languages. It explains the grammar but while explaining that even if some things are possible with JavaScript, they may not be advisable (not omitting brackets is a soapbox of Crockford’s). It explains objects and functions but often explains them in how they are different from their counterparts in other languages; prototypes, closures, and scope are all given their due time.

What some readers have complained about, I found very helpful. Having no experience with Perl, I found the Regular Expressions chapter very useful and exciting. The author uses flow charts to explain each special character in regular expressions as well as several examples of their use. The chapter includes a handy reference chart that personally I would like to have blown up and hung from my wall. An entire chapter is devoted to built-in methods, listing the methods, giving a brief explanation of each, and providing an example usage. The regex chart and method chapter makes Javascript: The Good Parts a worthy addition to your JavaScript reference books.

Finally a brief chapter specifically on style. A pensive, almost philosophical aside on good style in JavaScript by a master of the language. Whether you agree with his ideology or not, it’s a good read on the love/hate relationship of the language by a man who has devoted his career to it.

The Style

The book is laid out in a mostly linear fashion, starting with syntax, going through objects and then functions, and inexplicably jumping back to arrays before hitting the regular expressions. The book proper ends with the method reference (which might have been better placed as an appendix) and then the thoughts on style. The appendices are a little book on their own covering first the bad parts of JavaScript and then some auxiliary thoughts on JSLint and JSON (both projects of the author).

It’s a short, dense book that might warrant a second read in some future date. As it’s a book meant for more experienced programmers, it doesn’t require any projects for the reader to code themselves and it doesn’t waste paper on making sure you fully understand the concepts.

Summary

JavaScript: The Good Parts is a recognized classic in the JavaScript community and for good reason: it’s a concise and thorough ode to the language that emphasizes good practices and style. I feel that the beginning programmer would get lost if this were their first resource on JavaScript; rather it would be better as a reenforcement on a previous introduction to the language. Old hands in another language such as Java would find the book as an inspiration to continue learning JavaScript and would probably find Crockford’s grumpy slights at JavaScript more relatable.

Return Home