Programming JavaScript Applications - Book Review


In Programming JavaScript Applications Eric Elliott goes through the most important aspects of JavaScript development. Written in 2014, the book is still relevant, but it already has some outdated content such as the state of the JavaScript front end frameworks - Backbone and Angular 1 are the big players mentioned here. Based on this, the book should be considered an overview of ES5 JavaScript which looks into some of the usual aspects of building apps.

Chapters of interest: Out of the 10 chapters, the following are indeed useful: Functions(2), Objects(3), Modules(4), Building RESTful APIs(8), JavaScript Style Guide(Apendix).

The full book’s name, Programming JavaScript Applications: Robust Web Architecture with Node, HTML5, and Modern JS Libraries, pretty much describes what Elliott tried to accomplish with his work. The book offers a general overview of the language features, and then proceeds in analyzing some of the usual problems and solutions found in a large JavaScript application. In order to make the most of it, the reader should have a good understanding of the JavaScript language, and also some experience with both front end frameworks and with back end programming concepts.

The book is quite well structured, with a focus on the language features and particularities in the first chapters, and with quick analysis of higher level concepts in the second part. It has its share of good, self explanatory examples, but there are also code snippets way too long and tedious for their context.

While the first part of the book really did a good job in running through the language itself, the discussions about higher level concepts were sometimes too abstract. This is probably caused by Elliott’s decision to treat Logging or Feature Toggles as subjects worthy of their own chapters, but not include more complex topics such as Databases or Testing.

Programming JavaScript Applications starts with its best chapter - Functions. One of the reasons for the chapter’s great value may be that it was probably included in an early access release. Whatever the reasons, functions are essential in JavaScript, and Elliott takes the necessary time to cover them in depth.

The Objects (chapter 3), is also well written. On one hand, the author looks into concepts such as prototype-based programming, and enforces the obsolete nature of classical inheritance. It was nice to see that design patterns such as Flyweight and Factory are mentioned in the object creation context. On the other hand, Elliott also mentions more subtle aspects such as boxing and unboxing in JavaScript. However, this chapter misses an in depth look into object prototypes.

The following two chapters, Modules and Separation of Concerns wrap up the part of the book that focuses on core JavaScript concepts. The Modules chapter quickly runs through the popular AMD and CommonJS systems, but also mentions the ES2015 modules. A npm, Grunt and Browserify based setup is used as an example to showcase the module oriented structure of a JS app. While the information is enough to understand this entire process, the Modules chapter is far from fully covering JS modules.

The decoupling discussion is continued in Separation of Concerns(5). Elliott starts by running through some popular MV* patterns, and continues with a minimal server side setup based on Node and Express. Among others, the event driven programming concepts may be of interest.

The second part of the book starts with an insight into Access Control and Logging. Even though these are interesting topics, some of the information may be a bit too high level, or out of the scope of this book. The author looks into server security, malicious attack types and solutions to better analyze your logs. While this is valuable information, one may think that these topics were over analyzed while others, such as testing, were left untouched.

Chapter 8 covers Building RESTful APIs. While this has little to do with JS programming in particular, it is a good fit here due to the book’s target to cover robust web architectures. The chapter is full of useful information varying from suggestions to optimize for speed to a HATEOAS overview or alternatives to the JSON-based media type communication. As Elliott sates, this chapter could have been a whole book on its own, but it manages to present some important concepts everybody should be aware of.

The last to chapters, Feature Toggle and Internationalization are light discussions about other common issues in modern web apps. The wide range of topics covered by this book is proven once again while the author explains best practices of releasing new features to production.

To sum up, Programming JavaScript Applications is a nice read if you are an intermediate self-learner that could use a quick overview of the JavaScript world. However, you should keep in mind that the book covers ES2015 concepts superficially, and some of the technologies discussed are a bit dated in 2016.