3 ms·
EDIT: It is definitively only for full fleshed java-script web apps, not for quickly adding some gimmickry to a static webpage. As it happens I just started lo
by ma2rten 15y ago
EDIT: It is definitively only for full fleshed java-script web apps, not for quickly adding some gimmickry to a static webpage.
As it happens I just started looking into it a few days ago. Here is what I found:
The closure compiler really is it's biggest advantage. It compiles your code to really optimized javascript, with not one character too much. Only the parts of the library that you can actually use are compiled into your app. Also the library is pretty much extensive. For example their i18n code looks quite good.
The downside (in my mind) is that it forces a quite verbose java-like programming style on you (classes with getters/setters etc.). You also have to annotate your code with type information (a la javadoc) to take full advantage of the compiler. Also the DOM APIs are really ugly. They basically look like the bare browser apis.
Their is not really a big community around it either. But also means that nearly every line of code is actually used in a google application.
I havn't decided yet if I should use it for my next project.
- murz 15y ago> You also have to annotate your code with type information (a la javadoc) to take full advantage of the compiler I consider this an upside, especially on large JavaScript products with many engineers contributing (like the ones Google builds). Having your JavaScript checked at compile time helps ensure quality code, and helps to avoid errors at run time.
- ma2rten 15y agoI guess you are right, especially if you work in a team and want to build well documented, maintainable code. On the other hand it can be a bit tedious, if your main goal is to build a rapid prototype kind of thing.