5 ms·
Yes, I'd actually never heard of Closure until I read this. I wonder how it compares to jQuery/jQuery UI?
by udp 15y ago
Yes, I'd actually never heard of Closure until I read this. I wonder how it compares to jQuery/jQuery UI?
- bgarbiak 15y agoI don't think these can be compared fairly. JQuery is a simple, small and focused library while Closure is a big, all-in-one type of thing.
- ma2rten 15y agoEDIT: 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.
- daredevildave 15y agoWe started our current project using jQuery/jQuery UI and I found that it didn't feel up to the task. We're creating a complex single page application with many controls, etc. Things like menus, tree controls, etc, just don't exist in standard jQuery UI. And the plugins were mostly unsupported. I got up and running with the Closure library, very quickly, and I'm still finding it nice to use.