JavaScript: The Good Parts — Honest Book Review

This blog post was written in English to reach more people. I’m making a French training to learn JavaScript from scratch so if you’re interested, check out my website JavaScript de Zéro.

I’ve been programming since I’m 15. I’ve been programming professionally as a software engineer for almost 10 years.

I recently decided to switch to a full stack web developer career. I’ve been recommended the book JavaScript: The Good Parts from Douglas Crockford to learn more about Javascript.

Here is my complete and honest review about this book. If you’re in a hurry (who’s not nowadays?), you can jump right into the conclusion.

Overview

This book is about the JavaScript programming language. It is intended for programmers who have been working with JavaScript at a novice/intermediate level and are now ready for a more sophisticated relationship with the language.

This is definitely not a book for beginners or dummies. There is a lot of material packed into it. Don’t be discouraged if it takes multiple readings to get it. Your efforts will be rewarded.

The Book Review

The Good Parts

I really enjoyed this book, it’s clear and concise, but very dense. You definitely need to know JavaScript before reading this book. You won’t learn JavaScript but you’ll get explanations of why this code is better than this other code.

In a great introduction, the author explains where JavaScript comes from and why there are bad parts in this language. He then introduces how you can use a subset of the good part of the language to build better code.

Then he analyzes in a nutshell the JavaScript language core features, the fact that it’s a loosely typed language, have first class functions, prototypal inheritance, the object literal notation, the fact that he relies on global variables and all key concepts about the language.

He gives a very nice introduction to the programming tool called JSLint. A JavaScript parser that can analyze a JavaScript program and report on the bad parts that it contains. The use of this kind of tool can give you confidence that your programs contain only the good parts. Note that today, you would use ESLint.

What’s clear is that Douglas loves the language but is honest about the bad parts. And he doesn’t mince his words. It’s a real pleasure to read an honest review of the language by such an expert.

Reading this book will clearly makes you write better code. The bonus thing is that, each time he gives an advice, he describes why you should write things this way. And that really helps you learn how to sharpen your skills on what architecture to pick for your code.

The use of railroads diagrams is really nice to understand the syntax and the grammar of a programming language like JavaScript and regular expressions.

You’ll learn tons of useful tips like memoization, using an object specifier (to allow a function to take arguments in any order) and how to organize and architecture your code efficiently.

Douglas uses examples that start from previous ones reducing the number of lines of code of each snippet, that’s brilliant. Everything is straight to the point, no fluff, no small talk. Each line of each paragraph brings you value, it’s thorough and dense (~150 pages).

He discusses also why he thinks prototypal pattern is better than the classical (using classes like in Java) pattern. He also teaches you how to augment the capabilities of an Array and many other JavaScript objects by acting on the prototype of your objects.

Last but not least, he talks about why styling is important and give great advice on how to style your own code for maximum readability and to avoid producing error-prone code.

At the end you’ll also read a quick overview of the JSON syntax he created.

The Bad Parts

The book uses the JavaScript implementation of ECMAScript 3 (the mainstream current implementation targets ECMAScript 6). So the language used in this book is clearly outdated.

Conclusion

As you may have guessed already I highly recommend reading this book. It’s still relevant today even if the JavaScript version used in this book is outdated.

Indeed the author shares his reasoning behind each bad parts of the language so you can understand and apply this reasoning to the new coming stuff from JavaScript ES6, ES7 and ES8!

You’ll learn also so many good practices and so much good stuff to write better code that you should not skip this book. Reading that book will make you a better developer!

You can purchase this book on Amazon here: The Good Parts.

Bonus

If you want the essence of the book for free without having to read the whole book (even if it’s very concise and I enjoyed reading it) you can use these notes on GitHub.

Vous apprenez le JavaScript sans aucune expérience en programmation ?

Ma formation vidéo JavaScript de Zéro est faite pour vous.

Des bases de la programmation jusqu'à l'obtention de votre premier job, cette formation vidéo complète en français vous permettra de devenir développeur web.

Leave a Reply

Your email address will not be published. Required fields are marked *