Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When is it acceptable to use jQuery? [closed]

Tags:

jquery

I have recently been thinking alot about where to draw the line, and I wanted to get some answers from you experienced developers out there. When is it acceptable to reference jQuery in a web app?

Some supporting arguments for Always Using jQuery:

  • You can reference jQuery from Google's repository, where it might already be cached on the client, eliminating the extra hefty request
  • You don't have to deal with common cross-browser issues, as they are already taken care of
  • You enjoy writing the code because it is developer-friendly

Some supporting arguments for Never Using jQuery:

  • Unsettling dependency of a third-party library, which could contain costly bugs, and could lead to unjustifiably poor performance
  • You have to learn a new syntax (just when you thought you had regular Javascript figured out...)
  • Even the simplest of tasks can perform poorly, because of the inherent complexity of the framework

I listed arguments as part of the question because I do not wish to have answers weighing the arguments of both sides. I am hoping for always/never answers, preferrably with test case scenarios (vague or detailed).

For example: "If I ever need to do any AJAX requests in my web app, I always use jQuery".

like image 535
Josh Stodola Avatar asked Apr 04 '09 02:04

Josh Stodola


1 Answers

If I ever need to do anything past document.getElementById() in my web app, I always use jQuery.

I honestly find most of your con arguments against jQuery pretty weak, particularly the last one:

Even the simplest of tasks can perform poorly, because of the inherent complexity of the framework.

Do not agree with that at all. jQuery is incredibly simple while powerful and that's what I love about it.

like image 184
Paolo Bergantino Avatar answered Oct 30 '22 01:10

Paolo Bergantino