Read “JavaScript : The Good Parts”

A nice and short book. The author, Douglas Crockford, is a man who really understand why and how JavaScript was designed and evolved. So the book feels like an interesting tale told by a grandpa.

JavaScript is a language, also a system. Like every complex system, it has bad parts. The basic idea of this book is: we can turn JavaScript to a better language by “avoid using its bad parts”. This probably also applies to most systems. Actually smart people do this naturally, as long as they realize which part is good and which is bad. When bad features of a system are realized by more people (just realized, probably not understood, since bad parts are usually difficult to understand), more ppl will get around them or even invent replacement features. In this way bad features died out gradually. That’s why we can see different features in a system covering the same thing.

Another important point in this book is to keep codes human-readable. It’s easy to write machine-understandable codes, but costs much more efforts to make it easy to understand and transfer among humans. Lots of “bad parts” listed by this book are simply because they “mess codes up” more than the benefits they were designed for. An additional point is the most dangerous features are those who bring in hard-to-find bugs, not those notorious features that everyone will pay attention to.

This book is pretty short, but as the author says, it worths reading time to time.

Leave a Reply

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