DEV Community

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

Collapse
 
matthewbdaly profile image
Matthew Daly • Edited

I think there's historically been a window where jQuery is useful, and outside that window it's either redundant or starts causing problems.

If your application has around two or three hundred lines of Javascript, not including third party libraries, then jQuery is sufficient. As you go past that point, it starts getting harder and harder to organize your code, and you approach the point where something like React or Vue would be a better fit. It's not impossible to organize jQuery code properly, but it's a chore and is far less natural than with React, so you tend to build up technical debt. The legacy application I inherited pushed far beyond the point where you should look elsewhere, and the Javascript is a nightmare - when you add an already defined class to an element, you're apt to find it suddenly gains some unwanted functionality. I've started migrating it to React, but it's going to be a long job.

At the lower end, there's also less need for jQuery at the bottom end of that window. Due to better CSS and JS support in browsers, much of what it does simply isn't needed anymore. So that window of usefulness is getting smaller. With Bootstrap 5 planning to drop jQuery as a dependency, there will be even less need to include it.