DEV Community

Discussion on: ¿Is using Jquery a bad practice nowadays?

Collapse
 
ahferroin7 profile image
Austin S. Hemmelgarn

I think it's a good tool when used correctly. I also think that cash is a better tool unless you really need the support for ancient browsers that jQuery provides or are using jQuery plugins or Bootstrap (cash is smaller, faster, provides native TypeScript integration, and doesn't try to do things better done by other libraries).

The reason it gets widely maligned is that it's such an easy dependency to get rid of in many cases. The most widely used jQuery methods in most web apps are very easy to code in vanilla JavaScript these days without having to worry too much about cross-browser issues, so the only advantage for a lot of apps is that it makes code smaller (largely because $() is way shorter than document.querySelector()). Once you've got that dealt with, the only other big reasons to have it are jQuery plugins (which you usually don't actually need, especially if you're doing a web app that does need a full framework like React or VUE) and Bootstrap (which is getting rid of the jQuery dependency with Bootstrap 5).

That said, I very much think that jQuery should not be used for teaching new developers. As mentioned above, modern JavaScript can do almost all of what jQuery can without having to worry about cross-browser issues, so I think it makes more sense to teach that instead (it's a lot more useful in general).