Saturday, March 30, 2013

Review: "JavaScript Enlightenment"

JavaScript Enlightenment

It’s hard to keep up with the O’Reilly’s output of pancake sized JavaScript books.  On the one hand, this is a refreshing trend in an industry where publishers release expensive, thousand page books that will be obsolete within months.  On the other hand, with so many small books overlapping content, goals and target audiences, it is hard to know where to begin.  JavaScript Enlightenment (<insert your own Voltaire joke here>) is one of the most recent of these short O’Reilly JavaScript offerings, the second that I've read which originated as a free web book (the other was "Learning JavaScript DesignPatterns" by Addy Osmani).

This is a short book, with short sections, that covers the basics of the JavaScript language.  Each section of the book follows the same pattern: it starts with a description of a concept, follows with a code snippet linked to jsfiddle, and ends with a summary.  This pattern is followed so strictly that it begins to get tiresome.   Phrases like “What I really need you to grok…” are continually repeated, because there are only so many ways to write a summary paragraph. The writing style is overly informal and often imprecise.  No doubt this was intentional, as a way to make newcomers more comfortable.  I think this was a mistake; presumably newcomers to writing code in JavaScript are not newcomers to reading books in English.

The short chapters and linked code examples, however, will probably be very helpful to beginning JavaScript programmers.  And the code examples are fine, although not particularly interesting.   For instance, a recurring object discussed is the ‘cody’ object, an object about the author, with properties for living, age, and gender, to which the author adds a getGender() method.  Um, ok.  But why on earth would anyone write code like that in JavaScript?  Surely a better example could be found.  

I decided to read this book because of the title, but I probably should have read the description more carefully before getting it.  As an intermediate to advanced JavaScript developer, I wasn't the target audience.  The title is mostly just a gimmick and ‘Some Annotated JavaScript snippets for the Learner’ would probably be a more fitting. 

This is a print version of a free online book.  I read the eBook, which I received for free from the publisher, with the Kindle app on an iPod.  It still retains the feel of a free online book.  If you are new to JavaScript, you might want to read this book online, but I doubt you’d want to buy a hard copy, unless maybe to give thank you money to the author and publisher.  In any case, there are several high quality free JavaScript language books online (such as Eloquent JavaScript) that may serve the beginner’s purpose even better, not to mention websites like Codecademy.  

If you already know JavaScript reasonably well, you probably won’t get much out of either the print or the free version.  

Product Information: