Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is jQuery so widely adopted versus other Javascript frameworks? [closed]

I manage a group of programmers. I do value my employees opinion but lately we've been divided as to which framework to use on web projects.

I personally favor MooTools, but some of my team seems to want to migrate to jQuery because it is more widely adopted. That by itself is not enough for me to allow a migration.

I have used both jQuery and MooTools. This particular essay tends to reflect how I feel about both frameworks. jQuery is great for DOM Manipulation, but seem to be limited to helping you do that.

Feature wise, both jQuery and MooTools allow for easy DOM Selection and Manipulation:

// jQuery $('#someContainer div[class~=dialog]')     .css('border', '2px solid red')     .addClass('critical');  // MooTools $('#someContainer div[class~=dialog]')     .setStyle('border', '2px solid red')     .addClass('critical'); 

Both jQuery and MooTools allow for easy AJAX:

// jQuery $('#someContainer div[class~=dialog]')      .load('/DialogContent.html');  // MooTools (Using shorthand notation, you can also use Request.HTML) $('#someContainer div[class~=dialog]')      .load('/DialogContent.html'); 

Both jQuery and MooTools allow for easy DOM Animation:

// jQuery $('#someContainer div[class~=dialog]')     .animate({opacity: 1}, 500);  // MooTools (Using shorthand notation, you can also use Fx.Tween). $('#someContainer div[class~=dialog]')     .set('tween', {duration: 500})      .tween('opacity', 1); 

jQuery offers the following extras:

  • Large community of supporters
  • Plugin Repository
  • Integration with Microsoft's ASP.NET and VisualStudio
  • Used by Microsoft, Google and others

MooTools offers the following extras:

  • Object Oriented Framework with Classic OOP emulation for JS
  • Extended native objects
  • Higher consistency between browsers for native functions support.
  • More easy code reuse
  • Used by The World Wide Web Consortium, Palm and others.

Given that, it seems that MooTools does everything jQuery does and more (some things I cannot do in jQuery and I can in MooTools) but jQuery has a smaller learning curve.

So the question is, why did you or your team choose jQuery over another JavaScript framework?

Note: While I know and admit jQuery is a great framework, there are other options around and I'm trying to take a decision as to why jQuery should be our choice versus what we use right now (MooTools)?

like image 753
Andrew Moore Avatar asked Jun 13 '09 05:06

Andrew Moore


People also ask

Why is jQuery being phased out?

JQuery is useful, but what killed it was it's widespread use. Vanilla Javascript kept updating so that things that made jQuery special became things that you found in Javascript without jQuery. So, it started becoming obsolete.

Why jQuery is not recommended?

Back to the topic at hand on Why You shouldn't use JQuery in a framework? Because it'll just make your app heavy. Everything JQuery can do, VanillaJS/JS/TypeScript can do better and faster. It results to a terribly large amount of JavaScript code written.

Why we are using jQuery instead of JavaScript?

jQuery is a lightweight, "write less, do more", JavaScript library. The purpose of jQuery is to make it much easier to use JavaScript on your website. jQuery takes a lot of common tasks that require many lines of JavaScript code to accomplish, and wraps them into methods that you can call with a single line of code.

Why is jQuery so popular?

IT is the commonly the first library that JavaScript developers learn because: Its syntax for AJAX calls is very simple compared to the native XmlHttpRequest. It offers shorthand solutions to common JavaScript challenges, like sorting and filtering arrays. Many other libraries have jQuery dependencies.


1 Answers

That's an odd question... I get the impression that...

  1. you are very familiar with mootools and take full advantage of its OOP model, making your code easier to manage and support already.
  2. you realise that jQuery's purpose is somewhat different and tweaked towards DOM manipulation and AJAX and that mootools does do everything jQuery does AND then some.
  3. sounds as if you do not need to be using much in the way of 3-rd party plugins which makes the points of jQuery's popularity and support a bit less important.

Bottom line, is it the hype? jQuery is turning into one of these magical marketing buzzwords like 'AJAX', .NET and Web 2.0 — which is great for them but why do you need to justify staying with the framework that works so well for you? There's also the business considerations which I imagine will cover things like:

  • framework longevity, or is mootools likely to go away in the face of the ever growing jQuery — very doubtful, seeing as they just released 1.3 beta 1 and have 2.0 is in the pipelines for release by the end of the year.
  • cost of staff and their training (I imagine finding mootools programmers will be more difficult than these that slap jquery on their C.V / resume).
  • time (and cost) taken to maintain and extend your systems under each framework given your resources.

Both frameworks are great but I believe your interests are best served in staying with mootools.

like image 157
Dimitar Christoff Avatar answered Oct 18 '22 22:10

Dimitar Christoff