Closure: The Definitive Guide

Author: Michael Bolin
Publisher: O'Reilly, 2010
Pages: 592
ISBN: 978-1449381875
Aimed at: Existing and potential users of Closure
Rating: 3.5
Pros: A unique resource
Cons: Badly structured
Reviewed by: Mike James 


Closure is Google's very strange JavaScript compiler - does this book succeed in demystifying it?

Author: Michael Bolin
Publisher: O'Reilly, 2010
Pages: 592
ISBN: 978-1449381875
Aimed at: Existing and potential users of Closure
Rating: 3.5
Pros: A unique resource
Cons: Badly structured
Reviewed by: Mike James

 

No this isn't a book about the computer language - that's Clojure.

No this book isn't about functional closures in JavaScript - that's a book yet to be written.

No this book isn't about the psychology of emotional conclusions - that's ....

 

Banner

 

It is always a mystery why a particular word suddenly becomes overused but closure is one such word at the moment. In this case the title of the book refers to Google's very strange JavaScript compiler.

Why strange?

Well compilers are usually from one language to a lesser language but in this case Closure is a compiler that compiles JavaScript to ... JavaScript. Hey! That sounds easy - I could write one of those, it's called a file copy program...

Seriously there must be more to it than this but the big problem with this book is that it doesn't easily give the game away. The basic idea of the Closure compiler is that it lets you write elegant JavaScript - and yes JavaScript can be elegant- and it converts it into fast and efficient browser-independent code. In the process it also checks for potential problems and warns you. It adds compiler level checking to what is otherwise interpreted code. Not content with just being a compiler there is also the Closure Library which you can use to create apps without having to reinvent the wheel. There is also Closure Templates which simplify the generation of HTML from JavaScript.

Armed with the outline given above you should find the book in question much more useful. Even though it starts off with an introduction it never really manages to tell you what it's all about. It jumps in with examples that are deep into what you should know. Chapter 2 for example is on annotations for Closure JavaScript - I could have waited for this topic until after I'd mastered some ideas directly related to application building.

The next two chapters go into great detail about the Closure library. In Chapter 5 we meet classes and inheritance - standard JavaScript objects but with a few extras provided by annotations. Next we are off into event management and then a chapter on client server communications. Then we deal with UI components for no particular reason and on to debugging. In Chapter 11 we finally meet the Closure templates. 

The remainder of the book covers some mostly advanced topics that you might never need to know about. How the compiler works and how to modify it and advanced compilation, for example. Chapter 15 is on the testing framework which is of much more general interest and this more or less finishes the book apart from a collection of appendixes.

The big problem with this book is that it doesn't introduce anything in a gentle or even logical order. It doesn't really start simple and work up explaining the ideas as it goes - it simply tells you things almost, but not quite, in the manner of a reference work. As long as you have a good grasp on what Closure is all about and why you would want to use it then having this book at hand is a good idea. There is also a lot of standard JavaScript presented and while this is good if you don't know it you could also end up thinking that this is all something to do with Closure additions to the language - when they aren't.

This book isn't for the beginner and it isn't even for the slightly confused JavaScript expert. However it is a unique resource if you are already a Closure user - in this case just buy it.


Banner


Professional Node.js

Author: Pedro Teixeira
Publisher: Wrox
Pages: 408
ISBN: 978-1118185469
Audience: Intermediate JavaScript programmers
Rating: 3.5
Reviewer: Ian Elliot

Node.js seems to be growing in importance and we need some good book to tell us what it is all about. Is Professional Node.js the one you need?



Data Insights

Author: Hunter Whitney
Publisher: Morgan Kaufmann
Pages: 320
ISBN: 978-0123877932
Audience: Anyone involved with analysing data and presenting results
Rating: 4
Reviewed by: Kay Ewbank

With the subtitle “New ways to visualize and make sense of data” what is in it for developers?


More Reviews

Last Updated ( Monday, 13 December 2010 )
 
 

   
RSS feed of book reviews only
I Programmer Book Reviews
RSS feed of all content
I Programmer Book Reviews
Copyright © 2014 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.