views:

5504

answers:

16

I am trying to convince those who set standards at my current organization that we should use jQuery rather than Prototype and/or YUI. What are some convincing advantages I can use to convince them?

+2  A: 

One advantage of jQuery is the large community which has developed a multitude of plugins.

palehorse
+10  A: 

The 3 main advantages of jQuery are:

  • its light weight when compared to other javascript frameworks
  • it has a wide range of plugins available for various specific needs
  • it is easier for a designer to learn javascript as it uses familiar CSS syntax. jQuery is Javascript for Designers
Jahangir
A: 

I am a Prototype person, but I've used jQuery a bit. Honestly I don't there is much between the two that you can use as a 'selling point'. The YUI on the other hand is pretty bloated. I would never use it on any commercial grade application.

I found this page that talks about this exact subject.

dawnerd
Chris Heilmann, who now works for Yahoo!, had similar thoughts about YUI when he first started at Yahoo! http://www.wait-till-i.com/2007/06/16/yui-the-elephant-in-the-room-hackday-presentation-by-nate-koechley-and-chris-heilmann/ - discusses that. YUI 3 also makes significant changes to the API.
wrumsby
Never use YUI on a commercial grade application? Well @LinkedIn they decided differently, they use YUI... (http://developer.yahoo.com/yui/poweredby/)
Kdeveloper
+3  A: 

In my opinion, having briefly tried Prototype, and then later trying and loving jQuery: the jQuery API just feels much cleaner and well thought out. John Resig, the creator/architect of jQuery really knows his stuff, and it shows in the design of jQuery, as well as the various other impressive JavaScript projects that he has been a part of.

The whole concepts of querying and chainability fit very well with DOM manipulation, which seems to be the brunt of what people use JS libraries for. The online documentation is fantastic. Performance seems to be very good as well. The entire library fits into a relatively small package given it's capabilities. The plugin architecture is also very nice for extensibility.

I honestly haven't tried YUI, so I can't comment much on that. I do know that it is a rather massive library in total, though you can choose to download/use only specific modules of it.

A: 

Maybe you shouldn't? It all depends on what kind of application(s) you're building. If you are building GUI intensive applications, something like, say, Yahoo! Mail, then maybe you should consider using YUI or Mootools over jquery. Personally I'm a huge jQuery fan, but it is definitely best for adding a touch of interaction to an otherwise mostly static UI. On the other hand, if that is what you'll be using it for, then jquery is a lot simpler, has nicer syntax, and it has a lot of momentum.

Erlend Halvorsen
+2  A: 
  1. It's very small, especially when minified, and offers a lot in the core library.

  2. It's also easy to extend, and has an active community.

  3. Finally, it's extremely easy to learn; once you've grasped the core concepts you can start coding complex solutions right away.
conmulligan
+4  A: 

I would say my top reasons for using JQuery are:

  • Large development community and many plugins.
  • It's on Microsoft's radar and they are adding some plugin support and debug capabilities.
  • Very good documentation for a 3rd party library.
  • Lightweight.
  • Chaining capabilities are very powerful.
SaaS Developer
see http://weblogs.asp.net/scottgu/archive/2008/09/28/jquery-and-microsoft.aspx
craigmoliver
A: 

Why don't you create a quick comparison?

Take a task like "find all divs or tables which contain images of class foo and attach a click event to each of them which makes them expand 50%." Or something more relevant to what you're doing.

Then code that with jQuery, Prototype, etc, and compare. Which is shorter? Easier to read? Faster to run? (You can find a speed comparison here.)

Nathan Long
I'd go with a less arbitrary test case. How about: make an AJAX call to an external script and place the response into a styled message box in the middle of the screen.
nickf
+1  A: 

One argument in favor is this:

popularity + extensibility

1) If anyone needs to do X with JavaScript, it's probably been done with jQuery
2) If it's been done much, there's probably a plugin, if not native support

And if it's really unique, there are a lot of people to answer your question on SO or elsewhere.

Nathan Long
A: 

It has a good set of plugins and the coding style is unobtrusive which means it's not too hard to replace. There is also a nice drop in replacement for Ruby on Rails helpers called jRails.

Performance-wise they are all pretty close: http://www.kenzomedia.com/speedtest/ However, MooTools, dojo, ext, and Prototype all run faster in my environment.

My question is- why do you want to use it? Is it just because you know it better?

MattMcKnight
Good question!I want to use it because I think it has better syntax, more features available (when you include plug-ins), excellent documentation, and MUCH stronger community support. But we already have a company standard, so I thought I'd look for extra ideas to bolster my argument.
A: 

Jquery has been around for a few years, so like everyone else has said, it has a deep community, lots of plug-ins, and decent support. What set it aside for me was that it's easy to learn.

See http://visualjquery.com/1.1.2.html

Mike
+2  A: 

It's the most well though out language you'll find -- it's almost intuitive.

Want an element's width?

$('#something').width();

Want to grab an element, hide it, change it's background color and fade it back in?

$('#something').hide().css('background', 'red').fadeIn();

How about table striping for IE (assuming 'hover' class is defined)?

$('table tr').hover(function() {
  $(this).addClass('hover');
});

It's quick, mindless work like this that really helps sell jQuery.

Michael Thompson
+3  A: 

Here's a more recent speed test than the one provided above. Last time I ran it dojo was the fastest followed by jQuery, Mootools, Prototype, and finally YUI. Note I ran it in Firefox 3 and the speeds vary between browsers so test it out yourself.

Slick Speed Test

Guichard
A: 

If you are trying to convince people from a business perspective, Microsoft's recent decision to ship jQuery with Visual Studio could help establish some additional credibility. Then again, that could hurt your cause, depending on their opinions of Microsoft.

Andrew Van Slaars
A: 

I have been using jQuery for a few months now and have found it an enjoyable experience. The framework is clear and concise it has a great plugin architecture and is very well supported but frameworks are a very personal thing though and you should probably try a few it doesn't normally take long to spot the one that feels best for you.

Not sure if this will matter to you but Microsoft recently announced support for jQuery in the next update for VS 2008 Here is the blog post.

You can hear the John Resig, the guy behind jQuery, talking about it a various other frameworks on a recent Boagworld podcast. It might help you make up your mind its a pretty balanced piece.

Dean
+1  A: 

You can follow link text to knw more about jQuery, Why to use it and What are it's advantages.

sandhya shendre