

Closure: The world's most misunderstood JavaScript library - gmosx
http://www.gmosx.com/blog/agVnbW9zeHIPCxIHQXJ0aWNsZRjRiQIM/closure:-the-worlds-most-misunderstood-javascript-library

======
mhansen

        Among other things, I learned that:
    
          the powerful type system eliminates a large class of bugs the compiler eliminates the long name spaces (and the corresponding run-time look ups)
          getters/setters actually lead to better compression
          you can split the client side code in multiple, independently loaded modules
          the pseudoclassical pattern used for OOP is actually better than the functional pattern (when combined with the Closure compiler)
          you can easily extend the Compiler with extra features...
    

These sound very interesting - it'd be good to have an explanation of these
points.

~~~
gmosx
I really suggest you buy the book mentioned in the article. The author
discuses extensively (and, to me at least, convincingly) the design decisions
behind Google Closure.

~~~
fortes
Agreed.

I've been using the compiler for months, slowly adding type annotations as I
went, but not really "getting" a few key concepts.

Investing in the book was worthwhile, especially since it's the only source
for documentation for certain types of compiler optimizations or the module
functionality.

------
aidanf
I'm always wary of posts like this. It's tagged as book review but there isn't
much detail about the book in question. It is effusive in it's praise of the
book but gives very little detail of why the book is good. And it contains two
affiliate links to the book that it mentions. On second reading, it looks like
a post that just exists to try to generate affiliate clicks for the book in
question.

~~~
gmosx
This is no review, it's a post about Google Closure, a great library that I
think deserves more exposure.

------
dugmartin
I like the Closure compiler but not its templating library or its dom library.
The dom library is not abstract enough (you have to explicitly create dom
elements) and I generate all my js files via my own php based templating
library that is a lot more powerful and concise.

A great combination for the front end through is CoffeeScript + the Closure
compiler + jQuery (or your favorite dom library).

~~~
mshafrir
What templating library do you recommend?

~~~
gmosx
Well, I am using my own templating library, normal-template:
<http://github.com/gmosx/normal-template>

It's similar to json-templates but with a few extra tricks. You can find some
documentation here: <http://www.nitrojs.org/normal-template>

------
bryanlarsen
I'd like to read the article, but I consistently get the "this page has become
unresponsive" error. Not really a ringing endorsement for a Javascript
library. :)

~~~
gmosx
I am not sure why you have problems to access the page. Works ok for me. Try
again! This has nothing to do with Closure though, it's not used in the page
;-)

------
concavelenz
cool

