4 ms·
Closure: The world's most misunderstood JavaScript library
- mhansen 16y agoAmong 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.
- SamReidHughes 16y agoAnd you can get an explanation by reading the book mentioned in the article or by reading the documentation at http://code.google.com/closure/ http://code.google.com/closure/ .
- gmosx 16y agoI 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 16y agoAgreed. 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.
- bryanlarsen 16y agoI'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. :)
- AlekseyKorzun 16y agoYou had me at the Amazon affiliate link.
- dugmartin 16y agoI 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).
- gmosx 16y agoI am not sold on the templating library either. But the Closure library is quite extensive and abstract. It contains tons of useful (and well designed) UI components and compares favorably to something like jQuery UI. On the other hand there is a higher barrier of entry due to the lack of adequate documentation.
- mshafrir 16y agoWhat templating library do you recommend?
- gmosx 16y agoWell, I am using my own templating library, normal-template: http://github.com/gmosx/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 http://www.nitrojs.org/normal-template
- aidanf 16y agoI'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 16y agoThis is no review, it's a post about Google Closure, a great library that I think deserves more exposure.
- concavelenz 16y agocool