My review of: The principles of object-oriented JavaScript

Details

General comments

This book is a must-have for every JavaScript developer. It explains really well object-oriented programming in JavaScript.

The book was published in 2014. In IT time, it is ages ago. Some minor parts of the book are outdated or incomplete. That's why I think Nicholas should publish a second updated edition of the book.

What I liked

It is short: 6 chapters, under 100 pages. Each chapter is of decent size, between 10 and 20 pages. You can read 1 chapter a day. It is a nice rhythm to make progress without being saturated. But you will have to read some parts several times. This is very common while reading technical books.

Each chapter builds upon the previous chapter(s). The progression is logic and makes sense. It is linear. You follow a path, and you cannot get lost along the way.

Nicholas writes with simple words and provides simple code examples. Anybody can understand the concepts. It feels good.

Nicholas provides gems about how the JavaScript engine works under the hood.

The summaries at the end of each chapter are great.

What I would improve

The code examples use var. I would update them to use const and let. However, I do understand that letting var makes the book more coherent, with all the code being pre ES6.

In the introduction, Nicholas alludes to the 4 characteristics of OOP: encapsulation, aggregation (I usually see abstraction), inheritance and polymorphism. I would like to have some code examples and more details from Nicholas. There are so many different explanations of these concepts that it's hard to know wich one is the right one.

In chapter 1, Nicholas refers to the 5 primitive types. Since 2014, 2 new primitive types have been added to JavaScript:

  1. Symbol, added with the ECMAScript 6/ECMAScript 2015 specification.
  2. BigInt, added with the ECMAScript 2020 specification.
An update of this chapter is necessary. I would also include a table, just like the one on MDN. Or directly link to it.

In chapter 2, Nicholas details 2 literals for functions: declarations and expressions. Since ECMAScript 6/ECMAScript 2015, there is a third one: arrow functions. I would also detail the differences between the 3 literals, like this article: 7 Differences between arrow functions and regular functions in JavaScript.

The No Starch Press version of the book is more pleasant to read than the Leanpub version. I would improve the layout and the design of the Leanpub version.

Practice and remember

You can now test your mastery of JS object-oriented programming.