But I've been playing around with jQuery for the first time and wow - it's much more enjoyable to work with than vanilla JavaScript is.
Granted I don't work with JavaScript professionally (I use Java at work) so I might be overlooking jQuery cons that only become apparent in large professional codebases.
https://w3techs.com/technologies/details/js-jquery
Maybe jQuery is seen as outdated in the backend world, but I can assure you that in the webdev world jQuery and Javascript are almost entirely synonymous.
Someone might try to say that hammers are outdated in a world where a nailgun exists, but I can assure you the hardware store sells a lot more hammers than they do nailguns. (In this analogy jQuery would be a hammer and vanilla javascript would be pounding in nails with a big dumb rock).
Frontend engineer here, and I very much disagree with that sentiment. I'd also love to see what percent of the internet uses jQuery purely on the basis of traffic. There are probably a hundred million generated recipe blogspam pages that use jQuery and get 5 hits per month each, versus companies like Booking, Airbnb, Facebook, Google, etc, that get magnitudes higher amount of traffic. I'd also be curious what percentage of frontend roles are looking for someone proficient in jQuery versus other frameworks. Again, I would bet it to actually be a minority with lower salaries and companies that view their engineers as purely a cost center.
Not going to get into what role I think jQuery should play in pages and apps developed today more broadly, as I've seen that discussion hashed out a million times on HN and it never is productive.
> I'd also be curious what percentage of frontend roles are looking for someone proficient in jQuery versus other frameworks.
If they are using jQuery they don't need to hire a frontend engineer, because their problems are solved.
I agree that it's largely superfluous on webapps, but I would bet a crisp $20 bill that somewhere Airbnb is running a CMS-based site somewhere that loads jQuery.
I will rely on my nailgun v. hammer analogy for this again. I understand that the big scalable web experiences are built using nailguns. But for any sort of small web project that requires just a couple of dozen lines of code, jQuery is still very much implied.
React, Vue and Angular work slower because they have to actually find a difference between the last two versions of their “virtual dom” to get a set of changes to apply to existing dom elements, which they then do in the same way as everyone else.
jQuery is code smell today. The most popular use case, directly touching a DOM element is built into JS now (querySelector) and you really don't want to be doing that anyway.
There were other responses to the StackOverflow question, which managed to call an alert with just the single method call, but the top answer loaded in the entire jQuery library, to place a single native call.
However, this came at a cost: performance
Usually user experience is more important than developer experience at a certain breakpoint. As long as everything feels snappy, jquery is OK, but as soons as the APP starts getting slower, you just can't get along.
I'm not saying jQuery is slow in General but some things are (Dom, eventhandling) slower than native stuff and this sums up. Not to talk about highly optimized "Compile time" libs like svelte.