Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
July 31, 2020 04:20 pm GMT

Do we still need jQuery in 2020?

Last week, Bootstrap launched their latest version (v5 alpha) and one of the new features was that they no longer depend on jQuery, that got me thinking, do we actually need JQuery in 2020?

jQuery is one of the most popular libraries in the world, so popular that its used by 75.9% of all the websites. In this article well talk about how it became so widely used, and if its still worth learning in 2020.

Why is jQuery so popular?

JQuery was created in 2006, back when Internet Explorer was the most used browser and the web was totally different place than it is now. It solved a lot of problems for front-end developers back then; it provided a simple and clear API to build websites with ease. For example:

  • DOM manipulation: Using CSS selectors and some functions you can traverse and manipulate the DOM so easily compared to the vanilla Javascript approach.
  • Animations: JQuery provides some easy to use out-of-the-box functions for animating DOM elements, without needing to get messy with CSS.
  • AJAX: Making AJAX requests without jQuery was a hassle, but with JQuery you can do it in a couple of lines.
  • Cross-browser compatibility: JQuery provides an API that can work on most browsers, something that's very hard to achieve if you're using javascript, this saved developers a lot of problems.

Is it still worth learning in 2020?

The short answer is no, here's why:

Better alternatives:

Javascript has matured so much during these last years, it supports a lot of new APIs and its community has built so many great libraries to fill any void jQuery might leave. "You might not need JQuery" is a website that states alternatives for (almost) every JQuery feature, for example, let's say you want to add a class to a certain element:

// Solution in jQuery$(el).addClass("className");// What you need to do in pure JS:el.classList.add("className");

So as you can see, jQuery is more replaceable than we used to believe, especially with the emergence of front-end frameworks like React and Vue.

PS: Mixing two frameworks like React and JQuery is a very bad idea.

Size matters

Amazon famously found that every 100ms of delay in the load time of amazon.com cost them 1% in sales.
So loading an 80KB JQuery is a big problem, a problem we can avoid if we can find lighter alternatives.

Conclusion:

To summarize, I think the web right now is passed JQuery, we have better, and lighter tools at our disposal. But as a web developer, it's sometimes still required to use JQuery because as I've mentioned before, it's widely used, so you might run into situations where you have to use it, in such a case, you can just refer to their documentation and you won't have a problem because you'll be so well versed in javascript by that point.


Original Link: https://dev.to/mouadkh9/do-we-still-need-jquery-in-2020-4n48

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To