Tuesday, July 29th, 2008

Book review: “JavaScript: The Good Parts” by Crockford

Category: Book Reviews, Books, JavaScript

I heart David Flanagan. I’m making my way through “The Ruby Programming Language” this summer. Its exhaustiveness really satisfies. But a decade ago, my programming Bible was Flanagan’s “JavaScript: The Definitive Guide”. As I transitioned from a career in content to a career in code, “the Rhino book” taught me everything I needed to know about object-oriented JavaScript, DOM scripting and the other building blocks of today’s Ajax landscape. I’ve bought a hard copy of each of the book’s five editions. It remained, until recently, the only JavaScript book I’d recommend.

That all changed with the recent publication of JavaScript: The Good Parts by Yahoo’s Douglas Crockford. Crockford probably needs no introduction. His incisive website and frequent blog posts have championed JavaScript’s power and potential while calling out its drawbacks and frequent misuse. Now, with “JavaScript: The Good Parts,” he has managed to provide a reference as useful for JavaScript pros as it is for novices. Part language primer, part apologia and part critique, Crockford’s book draws from and extends many of his long-gestating themes about how to use JavaScript – and how not to use it.

The author’s premise is so simple and intuitive that it sounds like rubbish until you suddenly realize that this is how all programming languages should be taught:

When I was a young journeyman programmer, I would learn about every feature of the languages I was using, and I would attempt to use all of those features when I wrote. …

Eventually I figured out that some of those features were more trouble than they were worth. Some of them were poorly specified, and so were more likely to cause portability problems. Some resulted in code that was difficult to read or modify. Some induced me to write in a manner that was too tricky and error-prone. And some of those features were design errors. Sometimes language designers make mistakes.

Most programming languages contain good parts and bad parts. I discovered that I could be a better programmer by using only the good parts and avoiding the bad parts. After all, how can you build something good out of bad parts?


Posted by Dietrich Kappe at 3:51 pm

3.9 rating from 27 votes


Comments feed TrackBack URI

Javascript: The Definitive Guide _still_ lives on my desk. I rarely open it anymore but when I need it, it’s there.

Comment by jwlrs — July 29, 2008

Crockford’s book is great. Sort of “An Elements of Style” for JavaScript

Comment by Nosredna — July 29, 2008

It was an ok read. I found that the material was mostly a rehashing of Crockford’s website and a bunch of somewhat silly style guidelines that are more personal preference (don’t use increment or decrement operators? come on).

Out of all the JS books it’s certainly one of the better ones, but the Rhino book is far more useful (Crockford doesn’t even touch on the DOM, which granted isn’t part of the JavaScript language, it’s just as important if you’re doing JS in the browser).

Between the Rhino book, Crockford’s website, and his YUI Theater lectures I think you would be pretty well set.

Comment by tlrobinson — July 29, 2008

Great news, all though the Rhino book is awesome I think that the _language_ of JavaScript REALLY could use its version of “Accelerated C++” which for C++ is THE book to read for learning the language…
JS never had such a book, in fact most JS books (I’ve seen) suck BIG time…
I am hoping (and believing) that Crockford’s book will be just this type of book ;)

Comment by polterguy — July 29, 2008

This is the best JS book I ever read. This is the book that purely focus on the language itself, not cross-browser DOM manipulation. If you want a book to teach you how to deal with DOM, this is not it.

Comment by Shuo Geng — July 30, 2008

I can’t really see who it was for, it seemed like an overly complicated book for beginners. It was fun to read, but I don’t think I gained a whole lot from it since I was already familiar with Crockford’s work and opinions.

Comment by RobRobRob — July 30, 2008

Agreed, excellent book! I don’t agree with every word of it, but it was an eye-opener for me in a number of ways, and I’m more of a fan of JavaScript having read it.

Comment by timklein — August 8, 2008

Leave a comment

You must be logged in to post a comment.