Comment by lrvick
23 days ago
Everything I ever used jquery for 15 years ago, I found myself able to do with the CSS and the JS standard library maybe 10 years ago. I honestly am confused when I see jquery used today for anything.
Is there still anything jquery does you cannot easily do with a couple lines of stdlib?
The terse and chainable jQuery syntax is more readable, easier to remember, and thus more pleasant to maintain. Rewriting for stdlib is easy, but bloats out the code by forcing you to pepper in redundant boilerplate on nearly every line.
Jquery does many things in one line that requires a couple lines of stdlib. Writing less code is what libraries are for.
Until you have to upgrade it and it bites you
jQuery's big point was to give a consistent API over inconsistent browser implementations, so it typically saves you from bites more often than it bites you.
jQuery, for as long as it's been around has had very few major releases, 4 now.. and very few breaking changes... hardly "biting" ... other than those sites that are injecting a half dozen different copies of jQuery from different modules, and who knows which one you're actually working with, let alone 3rd party payloads.
I mean, personally, I've mostly used React the past decade and any integration directly to the browser has been straight JS/TS... but I can still see how jQuery can be useful for its' conveniences.