Closure: The Definitive Guide

Author: Michael Bolin
Publisher: O'Reilly, 2010
Pages: 592
ISBN: 978-1449381875
Print: 1449381871
Kindle: B0046RERYI
Audience: Existing and potential users of Closure
Rating: 4
Reviewed by: Mike James 


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

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. 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


The Art of Assembly Language 2nd Ed

Author: Randall Hyde
Publisher: No Starch Press, 2010 
Pages: 760
ISBN: 978-1593272074
Print: 1593272073
Kindle: B011DAPHEO
Aimed at: Beginners
Rating: 4
Reviewed by: Harry Fairhead

If you have always wanted to learn assembly language then this book might be just what you have been looking f [ ... ]



C# 7 and .NET Core: Modern Cross-Platform Development 2e

Author: Mark J Price
Publisher: Packt Publishing
Pages:594
ISBN: 978-1787129559
Print:1787129551
Kindle:B01N8UG78Q
Audience: Intermediate C# programmers
Rating: 3
Reviewer:Mike James

C# 8 is already being previewed and .NET Core 2 is out. Now is a good time to learn C#.


More Reviews

Last Updated ( Friday, 02 November 2018 )