Let's hear: jQuery in 2020?

github logo ・1 min read

I learned jQuery soon after I touched JavaScript. It was intuitive, useful and, well, popular. But time is marching on, and jQuery is almost 14 years old (See here).

Also, see this nice article on the subject:

Do you still use jQuery? Why or why not? Let the community know down below.

twitter logo DISCUSS (5)
markdown guide
 

For what specific purpose?

Most of the classic arguments for jQuery are no longer consistently valid. However, it's got a few small benefits for some users:

  • It can actually make your code significantly smaller. $() is about 10% of the size of document.querySelectorAll(), and a number of jQuery methods are much more compact than their DOM equivalents. Actually benefiting from this requires you to save almost 100kb of space with it though, so it's only worthwhile for big projects unless you want to try and rely on CDN caching for jQuery itself.
  • Bootstrap still uses it (though BS5 appears to be planning to drop this requirement). So, if you're using Bootstrap, you kind of have to use jQuery right now, and at that point, the point about space savings becomes more salient (and consistency is a good thing).
  • Some very widely used jQuery plugins don't have any particularly great equivalents that don't use jQuery. select2 is probably the biggest on e here (there are a number of alternatives to select2, but most don't have feature parity with it, and many have various small issues that are annoying to deal with which select2 does not).
  • Sometimes you still need a bit more than the regular DOM API's provide and don't want to work with something significantly more heavy-weight to get that functionality. jQuery is still decent ofr those cases.
  • It sill helps smooth over some of the peculiarities of different browsers. This is mostly of benefit to people who are forced to support IE, Opera Mini, BlackBerry, or iOS (yes, any iOS, not just old ones, it's got some of the same feature completeness issues that IE does).
 

those are some good points. Thanks for sharing!

 

Some frameworks use jQuery, and it'll still be around. People have dependencies and inter-dependencies on plugins written for jQuery and the idea of swapping them all out for something else is daunting.

For new projects, I haven't seen the point in jQuery for quite some time. I can't think of any new project that might want to use it, so I think it'll be on its way out for good by about 2021.

 

JQuery is still extremely useful. Until Blazor client development is ready for prime time, I'll be sticking with JQuery and ASP.Net MVC.

 

I dont use jQuery. I find vanilla js nowadays enough. When i need to polyfill some browser differences i go for specific feature polyfill (see: polyfill.io)

Classic DEV Post from May 10

Why I ignore the hype (and you should too)

It’s been 20 years since I made my first website. I've been burned by the hype ti...

Binyamin Aron Green profile image
I'm 21, and I'm a student and Designer/Developer. I like playing music and reading books. I'm a super-huge nerd.

Hey there reader...

Do you prefer sans serif over serif?

You can change your font preferences in the "misc" section of your settings. ❤️