views:

397

answers:

6

Microsoft recently announced that they were endorsing jQuery as an "officially" supported JavaScript library.

I certainly wouldn't argue that jQuery is a fantastic framework to work with. In fact, I just bought the book. But I'm curious to know why.

Specifically, I'm interested to know whether or not we web developers can expect jQuery to become the incumbent JavaScript framework or if it just offers points of differentiation like any other development tool. What are the merits of adopting jQuery versus say, Mootools or Prototype? Can I expect a "JavaScript Library" war similar to the browser wars as the individual frameworks battle each other for market dominance, or are there better frameworks for applying to specific problems?

I realise that as with anything in the development world, there will be some out there who have a religious fanaticism for their preferred library, so please: play nicely with each other when answering this topic.

+3  A: 

As to why MS endorsed jQuery, probably best asking ScottGu.

It seems as though jQuery is becoming the js hammer of choice for many, and the more that happens, the less love will be shown for the other libraries.

Personally, I find that it has a nice balance of features, and allows me to get most things done with the least amount of fuss, and like any other aspect of development, it's mostly easier and cheaper to stick with what you know if that works.

For things that need really slick animations, I used to find that mootools was a little bit smoother, but at least 8 months since I had to do anything with that much eye candy, so my testing probably out of date.

For an ajax widget fest, dojo or yui or extJS probably have a bit more to offer, but at the expense of library size and complexity.

So, sorry if that's a little vague, but like anything else it comes down to what is the right tool for the job, as a general purpose tool, jQuery usually wins for me, but it depends a lot on the job.

seanb
I think a lot of it has to do with the fact that it offers a lot of flexibilty and implementation that isn't covered my ms's client-side ajax libraries, with a fairly limited overlap... IE, they compliment eachother well.
Tracker1
A: 

Reinforcing what Sean says, it seems that there are many more quality, ready to use libraries for jQuery than other JS frameworks. This is also a factor in driving more developers to it.

allesklar
A: 

For me the community support makes jQuery a good choice but as has been noted above if you do require a site built around ui-widgets I would not go with jQuery (yet). The jQuery-ui framework is in its infancy and a good mile behind the likes of yui and extjs it will catch up but it will take time. However I believe 95% of web app needs are met with jQuery. It comes with a great selector engine also good dom manipulation / ajax and simple effects . All these coupled with its library size, plugin availability, ease of use and support make it a robust choice. MS's decision to ship jQuery can only enhance its noise in the community and increase the progression of the ui framework.

redsquare
+1  A: 

[deep subjective breath]

  • the last few times I've worked with dojo the team collectively found it to be very heavy, slow, flawed in some places (there was an obscure glitch in the $ function at the time iirc), and it's bootstrapping actually made it profile quite badly in use. It has a lot to like in engineering terms and it's medium-easy to extend widget-wise though I actually dislike it's widget implementation again for bloat and some weak OO. Ultimately I choose to avoid it these days.

  • I am consistently impressed by mootools animation, imho it's far ahead of anything else, but at this time it's also been a few months since I used it personally and I never found that the rest of the library was of much use to me.

  • jQuery I've found very overhyped, but it did seem superior to dojo as a framework, though again there were deep seated flaws iirc. It has a considerable amount of extension but not widget/components, and it degrades cleanly.

  • GWT is niche anyway and I don't trust it at all. Basically, I reject the assumption that google's automated software can write better js than I can :)

Coming clean though, I'm an arrogant sod and I've been doing this for a while, so I have to say that for anything but animation (too much maths, not enough time, just use mootools) I'm using my own code. AJAX isn't that hard. I like and trust my $esque CSS/Xpath based selector better. I have a cleaner implementation of components/widgets in a design methodology which suits me. Ultimately I have absolute control.

I'd recommend jquery/mootools (or even yui) for new starters and teams where standard knowledge is what matters. For anyone working on long term projects or who has the authority and time and skill to get away with it I recommend rolling your own and liberally stealing good ideas where you see them. :)

annakata
A: 

It is my personal opinion that the real reason behind jQuery's popularity is that it is so less intrusive than other mature frameworks. You don't need to do your whole application in JavaScript (like it is the case with ExtJS) nor need you to tackle with the whole framework like in YUI.

And please don't get me wrong here: I think that both ExtJS and YUI are great libraries - they are just to fat for small projects where jQuery with plugins fits very nice.

Matthias Hryniszak
A: 

Another library well worth looking at is extjs (now Sencha). They have the best widgets imho.

James Westgate