4 ms·
Ask HN: JQuery vs Google Closure
We are evaluating building a complex javascript / ajax web app.
What is the general opinion on HN on the above libraries? Google Closure hardly gets any mention so want to know if there are any developers out there who use Closure and what has been the experience?
Any other suggestions (backbone?) are also welcome
- jjm 15y agoThey both provide pretty much the same features, but jQuery has had more time and exposure so It is 'probably' a tad more stable. With regard to backbone and the like it really all depends on your ppl resources. If you want corp support you can forget about it. Sencha's ExtJs might be a better fit. Also note that backbone and almost all the wonderful modules out there haven't even reached 1.0. It is perhaps this that makes Googles offering compelling as they use this internally and relies on a stable API/codebase. For the record, I am a big backbone, coffeescript fan.
- nostrademons 15y agoClosure is used in basically every Google product. There's no comparison - in terms of pageviews, edge cases, and general real-world exposure, Closure is more widely used than probably every other JS library. I actually think they fill very different niches. JQuery is for sites that are primarily HTML but require some additional interactivity layered on via progressive enhancement. Closure is meant for JavaScript apps, where the whole client is basically written in JavaScript. Closure provides a lot of services that JQuery doesn't - there's a very full-featured widget library, and a JS compiler to minify your code, and a whole module system with on-demand code loading that's critical when your app becomes large. The flip side is that coding to Closure conventions is very verbose. It feels like Java, a lot of the time. If your app is going to have hundreds of thousands of lines and dozens of developers, this is the right move. If it's just you trying to bang out an interactive website in a couple weeks, JQuery will let you get the basics done in much less code.
- swah 15y agoDoes Google considers verbose good?
- nostrademons 15y agoThat's not really a meaningful question - Google's a big company with thousands of engineers, and most of them would say there's a time to be verbose and a time to be concise, and knowing the difference is basically experience. There is a strong belief - at Google and elsewhere - that any engineer should be able to read any other engineer's code. That means getting assumptions down in the code so there's nothing you have to keep in your head.
- rushabh 15y agoThanks everyone for the comments. Found a relating discussion on Stack Overflow too: http://stackoverflow.com/questions/1690197/what-does-google-closure-library-offer-over-jquery http://stackoverflow.com/questions/1690197/what-does-google-...