JavaScript Succinctly

This book was somewhat dated at the time of its original release and is now way behind the times and in need of a major rewrite.

My Rating: yesyesnonono





This book concentrates a lot on using objects with JavaScript. Given the huge number of new methods added to the built in objects in JavaScript when ECMAScript 5 was released, the best way to do many of the things illustrated in the examples has changed. In at least some cases the code shown wasn't the best way of creating those objects even before 2011. In some of these instances the purpose of the example is to show a particular way to create an object which explains why the object is being created that way, just that the author has chosen an inappropriate object to use for that particular example.

Perhaps the worst part of this book is when it starts to deal with specific objects. The chapter on strings is pointless apart from the partial list of methods it provides since you should never create a string object directly but should always use string primitives allowing them to be automaticlly converted to objects when necessary. The same applies to the chapter on numbers and more so since the chapter makes distinctions between integers and floating point - a distinction that JavaScript itself doesn't make. It also makes reference to hexadecimal and octal numbers without acknowledging that the octal format was removed in ECMAScript 5. About the only part of the chapter on Booleans that is useful is the list of what values are considered to be falsey in JavaScript.

The description of the difference between null and undefined is confusing. I had to read it several times before realising that the author had in fact got the two the right way around. On first reading it gave the impression that the definitions were backwards.

Also confusing is the author's use of the term head object to refer to the global object. As JavaScript can now be run in many different environments the assumption that the script is running in a browser where window can be considered to represent the global object cannot be made. The references to now obsolete window methods such as alert() don't make much sense given that the examples themselves use the far superior console.log() call for the same purpose.

With the chapter on the Object object, the book starts to become more useful although the omission of the new ways of creating objects introduced in ECMAScript 5 means that the chapter is very incomplete. It doesn't even cover the old equivalents to these new methods.

The book becomes even more useful once you get to the chapters on the Function object and the following chapters on 'this', closures, and prototype. The information presented in these chapters is really useful and well laid out.

The chapter on the Array object sees the book going back to being far less useful. The new methods added to this object in 2011 have completely changed the way that JavaScript allows you to interact with arrays and so there is very little in the chapter that relates to modern JavaScript programming.

Hopefully the author will write a new version of this book based on ECMAScript 6 before much longer as the overall concept of the book is really good and the only thing wrong with the book is that it is not up to date on the best modern practices. The book covers all of the essentials for using objects in JavaScript but using techniques more appropriate to 2010 than to what was available at the time the book was written. In effect the author wrote a book that was eventually published in 2012 that was basically made obsolete by changes to JavaScript introduced in 2011. Had the author had the foresight to write the book based on what was about to become available then the book would have had a far longer useful life before requiring a rewrite.

More Information from the Publisher

go to top

FaceBook Follow
Twitter Follow