DEV Community

Discussion on: Why do you use jQuery in 2019?

Collapse
 
garvinc profile image
Garvin • Edited

jQuery is more than just a bunch of features. It is also an opinion on how to do things. For example if you want to hide an element in vanilla JS do you use visibility or display?

For someone who has used jQuery for a long time, pulling in an 80K library and calling $('elm').hide() just makes sense. If jQuery is still supported, they get the performance they need and behavior they expect why should they change it? Wouldn't it make more sense to spend their time focusing on delivering value to their users?

jQuery also has a rich ecosystem of plugins an extensions that would be a pain to reproduce if you decided to migrate everything to vanilla js. Again you have to decide what is the most valuable use of your time.

It is understandable why people get excited about new technology but sometimes we forget why we are doing it. I would be more likely to shift from jQuery to a framework for code organization and maintainability than I would to vanilla js just because I can. The users of your site don't care if you use $() or document.querySelector.