DEV Community

Discussion on: Is JQuery still worth learning in 2021?

Collapse
 
nicozerpa profile image
Nico Zerpa (he/him)

That's a very interesting topic! I think I'm going to write an article about it later today.

It's good to know jQuery and there are still use cases for it. However, I don't think you should spend a lot of time learning it.

Nowadays, the biggest advantage of jQuery is that you can manipulate the DOM with less code. The DOM is fantastic, but it's quite verbose. With jQuery, you can do the same things in simpler ways.

Yes, now the DOM has new features to make things easier, like document.querySelector or fetch. But there are still quite a few tasks that require a lot of code if you want to go vanilla.

The thing is, if you are working on a small project, it's not worth adding an extra library. And if you have a big project with lots of DOM modifications, you'll probably need a UI framework like React, Vue.js, and friends.

If you do complex tasks and do the DOM changes yourself (either with jQuery or using vanilla JS), it can easily lead to unmaintainable code.

The big advantage of modern UI frameworks is that the framework itself takes the responsibility of changing the DOM, so you can focus on the business logic and declare how it should be displayed on the page.

Also, jQuery isn't hard to learn. If one day you have to work on a project that uses it, you can learn the library on the go. That's how I learned it 10 years ago! Just google a cheat sheet and you'll be fine.

Personally, I work on projects that use jQuery, but I no longer use it for new projects.

Collapse
 
leewynne profile image
Lee Wynne

Thanks, nice to hear the business concepts and frameworks and how they are important with constant collaboration at scale