22 ms·
I agree that the vanilla JS snippets seem hilariously more complicated, but simplicity isn't everything. In a corporate environment, if "I need to include jQue
by ThePadawan 5y ago
I agree that the vanilla JS snippets seem hilariously more complicated, but simplicity isn't everything.
In a corporate environment, if "I need to include jQuery as a dependency" involves asking another team how to set up custom deployment or whatever, and that is the difference of days between deploying a feature or not, then I'll definitely take the hit of 10 more SLoC vanilla JS.
- rchaud 5y agoIf it's a corporate environment, the standards are different, understandably. But the hostility to jQuery is also primarily concentrated among corporate devs that seemingly cannot imagine that jQuery might be valuable for use cases other than their own. Not every site out there is an database-driven SPA that needs QA review and a deployment pipeline each time an update is made. Lots of sites are just simple WordPress or even raw HTML pages that need a little bit of a facelift, with animations or transition. jQuery does the trick, and as a bonus, it's a much gateway drug to JS than the official ES6 documentation could ever be.
- FinalBriefing 5y ago> little bit of a facelift Proceeds to download 30kb (compressed) swiss army knife of a library when just a toothpick would do. jQuery is about as much of a gateway to ES6 as pot is to heroin. Devs who still use jQuery have had 10+ years to learn `document/element.querySelectorAll()`. Longer for event listeners.
- andybak 5y agoGosh. 30kb. > Devs who still use jQuery have had 10+ years to learn Or possibly we learned it in 9 years 11 months ago and still think jQuery was a more elegant solution.
- dageshi 5y agoWhen you learnt something with better more easily readable syntax, it's kinda hard to make yourself use something worse to save 30kb, when that saving will be lost with a single image on the page you're loading...
- edflsafoiewq 5y agoIncidentally, there's a few lightweight jQuery-likes you can use if you just want a nicer syntax. Zepto and umbrella are popular.
- rchaud 5y agoThe modern web is a soup of React, Vue and Angular packages with numerous dependencies. Couldn't they just use jQuery UI?
- Zababa 5y ago> Proceeds to download 30kb (compressed) swiss army knife of a library when just a toothpick would do. I agree that 30kb can be big, especially since it's JS that needs to be executed, but on the other hand if the toothpick means you save a minute, you can use it to optimize an image and end up with a lighter and faster website.