Book Review: JavaScript, The Good Parts


All languages have good and bad parts; to be a master developer in any language, you need to know and avoid the bad parts. Douglas Crockford goes through JavaScript, showing how to write beautiful code in this much-maligned language in an easy-to-follow and understand manner. Brendan Eich developed the language in a rush (I think in about 10 days) and did not have enough time to refine or polish it; so it has more than its share of bad parts. However he got some things right and these actually make JavaScript impressive.

The book is brief and dense but adequately covers how JavaScript should be used. Thanks be to God, I already had some JavaScript experience so it was not too difficult to read along but I still found some concepts confusing (especially regular expressions). Yes, don’t make this book your first JavaScript read, try jqfundamentals(jquery) and/or EloquentJavaScript. I hear David Flanagan’s book is also good.

I absolutely loved his explanation of the four patterns of function invocation. I finally understood what the this  object referred to in the different modes of invocation and also learnt about the that = this;  pattern. I liked his discussion of closures too although I found Nathans‘ explanation to be better.

There is a chapter that describes the api and how to implement some of the functions present in JavaScript; lots of good code. The appendices also describe the bad and awful parts of JavaScript; for example, calling the typeof operator on NaN returns a number which is surprising; the ‘falsy’ attributes (e.g. false, [], ”) have some really intriguing transitive comparisons too.

Overall, I enjoyed reading the book and learnt a lot however I won’t recommend it to beginners. For serious web developers, it is a must-read. (well, to me :)) and I think I’ll have to reread it a couple of times to really understand it well enough.

Lastly, I think JSLint is awesome but a pain to use. What do you think?

6 thoughts on “Book Review: JavaScript, The Good Parts

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.