DEV Community

Andrej Rypo
Andrej Rypo

Posted on

Stop using jQuery?

I bumped into this article that states jQuery can be replaced by native code: Why jQuery 4 is a good reminder to stop using jQuery
It implies that jQuery has no place in contemporary web development and that the new version serves no practical purpose.

It is indeed an interesting post.

Yet, I have to contra with three aspects the post leaves unmentioned:

  1. Developer's time is expensive. A more concise or fluent API that saves development time makes sense even in the modern age.
  2. DX: Looking at the examples how native JS can be used to replace jQuery, I still find the jQuery API more developer friendly. Like method call chaining, manipulating classes of multiple selected elements with a single call, etc.
  3. Legacy apps.

Don't get me wrong, I wouldn't use jQuery in a greenfield JS app, but it has its place in the browser environment.

Modern JS apps tend to opt-in for libs like lodash instead of jQuery to polyfill the utility methods jQuery provides by default.
Some more backend-heavy apps that don't use full-fledged JS frameworks I've worked with recently opted for Alpine instead of jQuery for DOM manipulation.

Having worked with multiple legacy apps using jQuery as well as apps completely written in Vue or React, this is just my humble experience talking.

I actually welcome the new/more-modern jQuery version. Replacing jQuery in legacy apps would be pain, so a refreshed version might be a blessing in certain scenarios.

In years since JS frameworks like React, Angular or Vue became popular, jQuery seems to have earned the disdain of many developers — not because it stopped working, but because fashion moved on.

What do you think?

Top comments (0)