Monday, February 03, 2014

I'm reading Nicholas Zakas book on Principles of Object-Oriented JavaScript (No Starch Press), and I'm really enjoying it. When you I first encountered JavaScript, I found it very functional, in the sense that I could make it do things I wanted it to quickly and easily, a trait which I had never found in Java. Then I read more on the web, and then I found Crockford and Resig and the important JavaScript books they wrote, and it started to make more sense. Where books like The Good Parts are prescriptive, because they have to be, and JavaScript is a language with clearly too much rope, that is not the mode of Zakas book. Instead, the approach here is to make clear statements about what makes JavaScript work - what makes it special - and the explanation here is an ideal mix of theory and practice, equally useful for the web developer seeking a better academic understanding of the language and for the classically trained C# or Java developer making sense of JavaScript's idiosyncrasies. Highly recommended as a companion to The Good Parts.

For instance, this kind of description is very concise:
Reference types represent objects in JavaScript and are the closest things to classes that you will find in the language. Reference values are instances of reference types and are synonymous with objects (the rest of this chapter refers to reference values simply as objects). An object is an unordered list of properties consisting of a name (always a string) and a value. When the value of a property is a function, it is called a method. Functions themselves are actually reference values in JavaScript, so there’s little difference between a property that contains an array and one that contains a function except that a function can be executed.
And of course, it is this concision that I appreciate here.

No comments: