JavaScript: The Good Parts

This is very brief review of a marvellous book on JS, JavaScript: The Good Parts, by Douglas Crockford.

It’s a somewhat thin book, given that JS has quite a few features, but the author’s contention is that you should stick to a small subset of those features.

Some extracts from the Preface:

  • This is not a reference book.
  • It is not exhaustive…
  • This is not a book for beginners.

These mean he’s not trying to teach JS, but rather to guide us readers as to what components of the language we should restrict ourselves to, that we may write programs of much higher quality than would otherwise be the case.

For your entertainment, he’s called the appendices (which are worth the price of the book):

  • Awful Parts
  • Bad Parts
  • JSLint
  • Syntax Diagrams
  • JSON

Regrettably, JS has many parts which are very badly designed indeed, and the so author steers the reader away from those.

Highly recommended for all of us who sail on the JS Titanic.

5 Comments

Care to expand on The Badly Designed Parts?

"Regrettably, JS has many parts which are very badly designed indeed, and the so author steers the reader away from those."

Which parts would you say those are?

One of the examples is the javascript == does not work correctly in all the cases

''=='0' //false
0==''//true

the suggestion is to use ===

other example is how the javascript "this" is sometimes bound to the global object based on invocation

I would also suggest you go through this exercise by the author of jquery

I recommend Crockford's GREAT 6 lessons video about JavaScript - everything good and bad explained in detail and sugarcoated with computing history.

Also, "JavaScript Pattern" (O'Reilly as well) is an excellent follow-up as it takes the ideas of the "Good Parts" to the next level and entirely dives into the Crockfordian style.

Highly recommended.

Leave a comment

About Ron Savage

user-pic I try to write all code in Perl, but find I end up writing in bash, CSS, HTML, JS, and SQL, and doing database design, just to get anything done...