But when I look at current statistics (https://trends.builtwith.com/javascript/jQuery) or Enterprise software like SAP's Fiori UI5 framework, there is very often jQuery implemented.
Why is that so? I mean, if all those people are right, who are complaining about jQuery, why those big players still use it? Is it really because of old habits and technical dept, or is it because it is good?
I must say, I really enjoy writing JS with jQuery, still today. It's short, understandable, simple... Maybe not the fastest, but I really don't know if that's really the case.
jQuery does one thing very well: abstracting away the peculiarities and idiocies of Ecmascript plus the browser quirks and provides a much easier way to do everyday things. The JS/ES implementations today are much better, than back in the IE days, but jQuery still provides an easier way to do things. JS standards bodies should have gone to John Resig with a big briefcase, give him a blowjob and asked him to let use jQ as it is and make it a standard. NOOOO, they had to implement everything in a convoluted way.
Plus a lot of devs know it from the heyday of the web, so why dump it, because "Stackoverflow statistics" say it's not trendy anymore? Gimme a break.
Speed issues in a JS app written in JQ in 2022? Gimme another break.
Now, you have these modern JS framework abominations... and people believe these are the second coming of God. :DDD Literal idiots everywhere. Everyone copies some bigdick thought leader/bigname company and think they evolved, when they actually do the same, just in a much more complex way.
Well, somehow you have to employ more people and slow down big corporate growth...
Programmers tend to love building new things more than maintaining code and we're _really_ prone to misattributing the causes of problems, especially when that would mean admitting that we're not as good at managing complexity as we hoped. When Facebook's marketing push really got rolling, it started a fad of people crapping on jQuery and talking about how amazing React was — and I saw almost none of them built something which was either faster or, within 6 months, much easier to work on. The only exception I remember was a time where the React rewrite was what gave them political cover to slow feature development enough that they could fix a known design flaw.
That's not to say that newer tools are bad but the teams who did see benefits were already relatively mature: they actually measured performance, had a stable testing approach, refactored regularly rather than letting technical debt pile up until is burst into flame, etc. They would have been successful with almost any tool, and tended not to trash-talk jQuery when they left it behind since part of experience is understanding how much your choices matter.
Meanwhile, old can also mean the bugs have been worked out, doesn't change too drastically, and it's relatively stable.
jQuery gets the job done and has a low barrier of entry.
Worry less about what people think about a tool, and use the best tool for the job (even if you get flack for it). You'll win in the long run. When they're having to refactor their codebase, you're skirting by the wayside with reduced maintenance time and costs.
I’ve seen a few people over the last few years saying that whatever framework is currently popular should be built into the browser, and in its era people were saying the same thing about jquery - and vigorously arguing for it.
- Browsers and the web becoming less painful to work with out of the box. If we all keep using jQuery, will these issues it fixes ever be addressed?
- Dependencies that hang around for a long time tend to increase technical debt or fear of common dependency-related issues
- A huge part of membership in a community involves signaling. Some of that signalling means syncing with what isn't liked, and speaking against it.
So you can get some people who want to live in a better world, some who want to be less annoyed by clutter they don't need, and others who just want to belong...and they see jQuery as a cheap ticket, especially if they aren't using it.
Still, jQuery is like any tool, best used by those who have a plan for working around the troublesome aspects...
If you are making a web-site and not a web-application, it's great.
A lot of pain comes from a project that evolved from a complexity where JQuery was a good choice to a complexity where it is not a good choice, and the work wasn't done to convert the existing stuff.
But it came at a cost. jQuery basically is a function that is linked to '$':
function jQuery() {
// ...
}
$ = jQuery;
The problem with jQuery today is, that most of the time the cross browser stuff is no longer necessary and therefore slows down your app drastically (especially hooking in every event handler). Most jQuery 'advanced' features are not used very often. This basically means, that in simple apps you could nearly replace jQuery with: $ = document.querySelectorAll;
jQuery is also often very inconsistent. Take for example the function itself - you can use different types of arguments (jQuery(function(){}), jQuery('string'), jQuery([]), etc.). In a small app, this does not make a difference, but nowadays, with HUGE JavaScript applications, this can be a real problem.Most users liked the easy API of jQuery and don't know about these facts, so jQuery often is still the way they go...
Give it another 5-10 years and I might find myself saying the same about React.
For example, dev adds jQuery to a project when 5 to 10 lines of vanilla JS would do.
I would question the notion that jQuery was considered a failure back in the day. jQuery was practically necessary if you didn't want to deal with cross-browser issues.
UI should be declarative and cross-platform.
https://docs.google.com/document/d/1LPaPA30bLUB_publLIMF0Rlh...
It still works, but you "might not need it" if you were using it for "workarounds"
I used it extensively because I never really like the imperative approach, it’s a bit too error prone