Four good books to change the way you see or write JavaScript

Published at Jun 10, 2013

Most programmers I know say they do not like JavaScript. I understand the language has many things that are odd. But I’m sure that not liking JavaScript, may also come from the fact that people don’t know the language beyond the basic syntax and from copying / pasting scripts found on the internet.

JavaScript has braces, semicolons, has Java as a part of its name, but it doesn’t work anyway like Java or any other language derived from C, such as C#. Therefore, to use JavaScript in a correct manner and even begin to enjoy the language we have to understand “the JavaScript way”.

Java - JavaScript

Here’s a short list of four books I read about JavaScript that will help deepen your understanding of: the language, the interactions with the browser and how to write code faster, more organized and elegant, using what JavaScript has to offer.

The books listed here may have overlapped subjects. But in general, these are books that complement each other and explains different aspects of the language and the way it interacts with the browsers

JavaScript: The Good Parts by Douglas Crockford

In my opinion this book is a good introduction for anyone who wants to begin to understand a bit beyond the basic syntax of the language. No, it is not a book that will delve much into the language, will only begin to cover some topics in a more advanced way. But mostly, will help you understand a little better what’s good about JavaScript. If you already understand well the syntax of JavaScript, you already know how to work with objects and functions you probably can skip this book.

JavaScript Patterns by Stoyan Stefanov

As the name says, will discuss patterns. The patterns here are related to specific features of JavaScript, for example, how to reuse code using Prototype. It is also about conventions adopted in the language, how to solve the problem of global scope, how to use constructors, among others. The book also addresses some of the GoF patterns , but with a vision focused on the characteristics of JavaScript. This is certainly a book that should be read by any developer who wants to take JavaScript more seriously.

Secrets of the JavaScript Ninja by John Resig

For me, this is the best book about JavaScript from the didactic point of view. Great examples, and clear explanations and many details about the language. In this book, was the best explanation I’ve ever read about how closures work in JavaScript. From the books in this list this is the one that deals more with the interactions between JavaScript and the browser, demonstrating strategies for dealing with the differences between the major browser manufacturers.

Effective JavaScript: 68 Specific Ways to Harness the Power of JavaScript por David Herman

This is without doubt the book that goes deeper into the language. It’s a short book, but with a lot of information. If you decide to read this book after the others (I recommend that), you will see that some of the tips will be already covered by the other books, but most of the 68 specific ways will bring enough information. Some of the items should be read more than once because they are quite complex (at least to my limited brain), but the book is pure information from beginning to end.

All of this about JavaScript?

It may seem too much for a language that often seems so simple, and in fact, the JavaScript syntax is simple. But some concepts are not well-known especially for programmers familiar with static languages and not used to functional programming. If you do not want / can read all, but still want to read about JavaScript I would say to read at least two:

JavaScript Patterns and Secrets of the JavaScript Ninja . These two cover most of the issues that we see in everyday work, and certainly will help raise the level of “copy / paste” to reach the level of understanding what really is going on when you make your applications using JavaScript.

Good reading!