DEV Community

Nico Zerpa (he/him)
Nico Zerpa (he/him)

Posted on

7 2

Should you learn jQuery in 2021?

Back in the day, Microsoft Internet Explorer was the most popular web browser. It was awful at following web standards. Often, you had to code everything twice: one for standard-compliant browsers, and another for IE.

When jQuery first appeared in 2006, it allowed developers to code only once. The library itself took care of browser compatibility. That made jQuery the most popular JavaScript library of its time.

Not only that, but it also was easier to use than the standard DOM. You could do with jQuery tasks that require complex logic if you used vanilla JS.

However, things have changed. Internet Explorer is no longer with us, and practically every browser follows the standards to the letter. Also, standards have improved and became simpler. And that brings the question: is it worth learning jQuery in 2021?

It's good to know jQuery and there are still use cases for it. However, you should not spend a lot of time learning it. jQuery should not be your focus this year.

The biggest advantage of jQuery now is that you can manipulate the DOM with less code. Yes, now the DOM has new features to make things easier, like document.querySelector or fetch.

Yet still, the DOM is quite verbose. 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 to display content on the page.

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


p.s. Did you like what you've read? Every week I send an email with free tips and insights to become a better JavaScript dev. If you're interested, https://nicozerpa.com/newsletter/.

Sentry blog image

Identify what makes your TTFB high so you can fix it

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

Read more

Top comments (1)

Collapse
 
snekattack profile image
snekattack

jquery is useful for the scripting, you could most likely simultaneously use react wich would make stuff 100000 time easier that's now what I recommand

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay