« Investigating Theme Spam
» Redirecting Users’ URLs
After the sections on recursion, scope, closures, currying, and memoization I was surprised not to see a section on the Y combinator, which allows creating recursive anonymous functions. There’s a blog post with a nice derivation, but it seems oddly absent from the book.
I don’t think too much about these few oddities, though, it takes a certain amount of chutzpah to distill a beautiful language from a clunky, heavily-abused language and it’s harmless to see that manifest a bit of quirky style. Mostly I spent my time reading, pondering, and tinkering with the example code. There are some great examples for creating objects and working with the prototypical inheritance, and the array sorting code (p80) is an especially inspiring bit of useful code.
The only serious negative of the book is the incessant and distracting typos. There are countless small code layout issues, bad line breaks in comments (p39), weird indentation (p40), added line breaks in code (p41), occasional camelCase. There are also a few typos in the code segments that will cause weird exceptions or, worse, silent failures. If the book didn’t have so damn much useful content I’d suggest waiting for a third printing to correct these errors (I read the Sept 2008 printing, look for a [9/08] or later in the lower-right corner of the copyright page). The poor copyediting is compounded by O’Reilly’s awful errata page; you can’t filter by printing and it includes many duplicates, making for a frustrating slog through clutter to track down why a particular sample doesn’t run.