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




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.



Expert Performance Indexing in SQL Server 2019

Author: Jason Strate
Publisher: Apress
Pages: 615
ISBN: 978-1484254639
Print: 1484254635
Kindle: B0825PBF8R
Audience: Performance DBAs/Developers
Rating: 4.5
Reviewer: Ian Stirk 

This book discusses indexes, a primary means of improving performance in SQL Server, how does it fare? 

Machine Learning For Dummies, 2e (Wiley)

Author: John Paul Mueller
Publisher: For Dummies
Date: January 2021
Pages: 464
ISBN: 978-1119724018
Print: 1119724015
Kindle: B08SZHJGJW
Audience: General, but not too dumb
Rating: 4
Reviewer: Mike James
Dummies probably need machine learning to cope...

More Reviews

Last Updated ( Friday, 02 November 2018 )