Review: “Scope and Closures” by Kyle Simpson, O’Reilly Media

Cover of Scopes and ClosuresThis approaches my idea of perfection in a technical book. Simpson takes a limited and important part of JavaScript (scopes and closures, obviously) and explains it, briskly, and thoroughly, with simple code samples demonstrating how these language features work and how a working developer can employ knowledge of them to improve their work.

Like many long-time web developers, I learned JavaScript by picking up pieces here and there as necessary to get something specific done – very different from how I learned, say, PHP or Java. That “Brute Force and Ignorance” (BF&I, I call it) approach to JS began failing in the last few years as JavaScript changed from being an accessory to being a core component of a modern website, and I began a more systematic study of the language.

Simpson’s book is a very welcome addition to my effort. The book is short, covers its subject clearly and comprehensively, the style is good-natured with an insistence of getting things right, and uses examples simple enough that you don’t need to tap out code to get the point. If you’re already fairly experienced with the language you can read this in bed. It was a pleasure to read and a cinch to understand. Here’s a sample: “Closure is when a function can remember and access its lexical scope even when it’s invoked outside its lexical scope.”

I recommend this very highly for intermediate-level JavaScript users who want to improve the command of the language.