Share On Twitter Facebook Google+ LinkedIn Pinterest Tumblr Reddit
Question

Is jQuery dead?

Tags: jquery javascript
Date:
Status:Unresolved
Question Id:34

How many JavaScript questions can be answered with "use jQuery"?

Looking at JavaScript questions, all too often the answer seems to be "use jQuery," sometimes in as few words. We can end up with answers which feel more like plugs getting the asker to try jQuery (the Silver Bullet) than a concise solution to their question.

Answer
Date:
Correct:No

When any of the following is true:

  • It is the entire answer, with no explanation of exactly how jQuery helps
  • When the problem can be solved simply without jQuery
  • When the question specifically asks for no javascript frameworks
  • When the question is tagged or mentions a competing framework
  • When someone else already posted it
Answer
Date:
Correct:No

JavaScript !== JQuery

JQuery is largely a replacement for the DOM. It provides a lot of tools for working with browser specific stuff, not JavaScript specific.

There's questions about JavaScript itself that can't be answered with "use JQuery". Questions about scope, the way functions work, objects, etc.

However, JQuery can be used beyond questions about JavaScript or the DOM. Just the other day a waitress asked "What would you like?" at a restaurant to which I replied "just use JQuery". She knew precisely what I wanted at that point

Answer
Date:
Correct:No

Yes, it saves loads of time and frustration. jQuery is great. I love jQuery. But here's personal experiences where I won't want "Use jQuery" as an answer:

  1. When I'm using Greasemonkey, jQuery doesn't work without an ugly workaround. Usually I don't want to bother.

  2. If a client's site already has another JS library in play (read: Prototype / Scriptaculous), running jQuery.noConflict() in tandem is a last resort; I've tried it before and all it causes is problems and confusion:

    So, this $ belongs to jQuery? No wait, Prototype. So why is all the Prototype stuff broken if jQuery's in noConflict mode? Why is Firebug reporting that $ is the jQuery object? Ok, now I have Prototype working, but some of the jQuery plugins are screwing up. [string of expletives from frustration]

    I've learned that the appropriate solution is to Google prototype [whatever I'm trying to do] example and I get by just fine. If that ever fails, I'll ask on StackOverflow.

  3. By the same token, when I'm freelancing on a client's web site, if the client is requesting animations and AJAX calls on a page, I'm going to use jQuery. But I'm not going to add the entire jQuery library to his page's overhead when all I need is document.getElementById("foo").

Don't get me wrong. I'm a huge supporter of jQuery. I author plugins, for God's sake. It's just that jQuery is only a subset of JavaScript. It's usually a great option, but not always the best option.

Answer
Date:
Correct:No

Obviously simply saying "use jQuery" doesn't solve anything it's self. But as a framework/library jQuery is designed to solve, or make simple, many common JavaScript problems. That's why people find it so useful and why the answer to so many of the JavaScript questions posted boil down to "use jQuery".

That being said it's not a replacement for understanding the JavaScript underneath.

There are places where jQuery has a bug, or you're trying to do something that isn't within the scope of jQuery, jQuery UI or any of the jQuery plugins then you're obviously going to need to write your own JavaScript. There are also things where for performance issues you won't want to use jQuery.

So really it depends on what the question is, but for the most common questions "use jQuery" is the answer, and that's kind of the point.

Answer
Date:
Correct:No

Almost all developers have forgotten about the main goal of jQuery. It was made for cross-browser purposes, but over time it became something more than just a lib solving cross-browser problems.
I only used this library in projects where it was already used. In fact, I find jQuery redundant.

I saw below that you wrote that it helps to understand JS and other things. This is a big lie))
I ask you one thing: never recommend beginners to learn libraries, frameworks, and other things before getting a strong man in JS itself, design patterns, and the like.

P.S. why do so many people think that package sizes are the only problem!? What about the fact that the browser has to analyze the code and it takes some time!? What about many other things?
P.S.S as I said, I hate this library and always did.

Answer
Date:
Correct:No

Funny you should ask. I just had to work with some customers of a customer who are in China. All sorts of problems come into play when you're dealing with JavaScript and CSS libraries, CDNs and The Great Firewall. It turns out, one of the issues was an occasional inability to access jQuery and dependent libraries. I could've opted to just have all libraries local, but it was a small set of work. So, I decided to nix jQuery and rewrite all of the bits in native JS (we're not at Bootstrap 5 yet.). First, it had been quite some time since I wrote much of anything that wasn't dependent upon jQuery. As a full stack developer, I have to pick and choose how I spend my time staying on top of things and it often comes down to something intersecting with "if it ain't broke, don't fix it." For quite some time jQuery was working fine for us. But now, it was at the heart of a problem and this caused me to brush up on the latest offerings of native JS. I must say, things have greatly matured. JavaScript's interaction with the browser, particularly events and the DOM, has lost a lot of its earlier, convoluted feel. Code ends up more succinct without being unduly terse, making much more obvious sense when browsing through it. I also found I was doing a lot less back-and-forth with the documentation (meaning it felt more natural to code with it) and coding with calls, parameters and tag attributes was much less tedious and error prone. This sounds much of what I was looking for when I went to jQuery so many years ago. So, if JavaScript has more than a certain threshold of solving the problems of why we went to jQuery in the first place, there's really no reason to force our customers to download and execute yet another layer of code in their browsers. So, yes.

Answer
Date:
Correct:No

In my opinion, it's due to the shining object syndrome, where frameworks such as react, vue, angular...and all the others are the in thing ATM. However, I think it's important to have an understanding of jquery as it can help one understand and appreciate the basics powering such frameworks as well as a better understanding of javascript.

Answer
Date:
Correct:No

Query isn't going to go anywhere until businesses can realistically assume that the vast majority of their customers are on modern browsers. So it might be dying, but, much like Adobe Flash, it's going to be a slow death.

Answer
Date:
Correct:No

jQuery is fine. Becoming expert DOM manipulator in raw javascript won't make you a good programmer. Pure DOM manipulation is fairly trivial anyway, and jQuery is just a utility lib that makes the grunt work easier.

 

I see jQuery mainly as syntactic sugar and cross browser normalizing lib. It also does some clever behind the scenes grunt work such as removing data and event listeners from removed elements etc.

 

It's very useful depending on what kind of stack you're working with. I render everything serverside and then manipulate the dom manually, so jQuery provides lots of value for me. If I was working with something like React, there wouldn't be any reason to include it. As I said, dom manipulation is easy. It's like laying bricks at the construction site. Software architecture is the hard part.

 

Many developers are condescending to people who use jQuery. jQuery users are often seen as "lesser" developers. Ignore that. jQuery is just a tool, nothing more. It's also super popular and yes, most of the people who use it arent great developers. Just like most of the people who eat pizza aren't geniuses. That doesn't mean that everyone who eats pizza is a retard.

 

TL;DR - Get familiar with and try learning the native DOM api, but don't be afraid of using jQuery if it provides value for you, ignore the haters.

Answer
Date:
Correct:No

It's not dying. It just doesn't fit into the current thinking that manually manipulating the DOM is bad. At it's core, it's a convenience layer for doing something that Angular, React, et cetera obfuscate away completely.

 

You'll see Bootstrap mentioned in a similar capacity these days, although not as frequently, as people begin to adopt CSS frameworks like Inuit, Susy, Bourbon, et cetera that leverage a different approach to providing the same kinds of features.

 

Neither one is dying, or even remotely close to going away. But if these trends continue, they'll continue to become less popular for new projects.

Your Answer

Review Your Answer