This article may contain affiliate links. If you buy some products using those links, I may receive monetary benefits. See affiliate disclosure here
Update – June 2020: This article was originally written in 2019. A lot have changed after that. For example, recently, Bootstrap has announced that it’s going to remove jQuery dependency starting from v5. So, some of the points below may seem outdated.
The relevance of JQuery has been a topic of debate among web developers for a while. As a person interested in Javascript, I was curious to know what others have to say about it.
So I skimmed through the history of Javascript along with some of the interesting debates on several developer forums and a few Reddit threads to know other’s opinion about the worthiness of JQuery. Everyone had their own opinions which ranged from JQuery is dead to JQuery is here to stay.
Then I thought I would write about what I have understood as a spectator. I have tried to view the topic from multiple viewpoints before coming to a realistic conclusion.
First of all, let us dive into the brief history of this famous library and Javascript as a whole.
What is JQuery & How it became so popular?
Created by John Resig, JQuery got released on August 2006 primarily as a Javascript library to ease DOM Manipulation.
It was a time when Internet Explorer ruled the browser world. Google Chrome was not even in the scene. These old browsers implemented Javascript in different ways resulting in lots of compatibility issues.
That’s the time when JQuery was born. It filled the potholes of native Javascript implementation by browsers and offered a consistent and smooth surface for performing various DOM Manipulation, animations, and AJAX requests.
Due to its ease of use, neat syntax and cross-browser compatibility, it quickly became the favorite tool of front-end developers. It became much popular than other libraries like Mootools, Scriptaculous, and Prototype.
Owing to the popularity, developers around the world began rolling out hundreds of plugins and front-end frameworks depending on JQuery, many of them became popular. That was how this library really established its roots.
History of Major Browsers, Javascript & Frameworks [Infographic]
What Has Changed After That?
As time went by, the conditions gradually changed for the good. Javascript as a language became more mature. Newer APIs were released which enabled developers to achieve the same result in vanilla Javascript. One important example is the Selectors API which made the selection of DOM elements much easier.
- JQuery gradually lost its uniqueness. This can be attributed to three main things:
- Javascript matured as a language, newer APIs came
- Modern browsers like Google Chrome & Firefox came and they implemented JS consistently
Modern & advanced Javascript frameworks & libraries became a trend
Technologies like AngularJS, React & VueJS came and they made JQuery look obsolete. People began questioning the significance of the latter.
Since one is a library (collection of functions) and the others are frameworks (or framework-like), their use cases never completely overlap each other. A library is good at what it is meant to do and may not be good for what it is not meant for, and vice-versa.
Is Jquery still relevant? What are the current trends?
Even though it is obvious that the library is gradually losing its grounds, it is still relevant.
A lot of websites make use of it. According to BuiltWith, JQuery is still in use on a staggering 77% percent of the top 1 million websites. So if you ever come across to work on such a website, you should know the library.
Apart from the popularity, JQuery is a beautiful library. Its chaining methods are crisp and elegant.
Should you use it?
In web development, an important thing is to choose the right tools and technologies for the job at hand.
When to use it?
Suppose you are working on a simple WordPress website with minimal user interactions. However, you also require a bit of animation or sliders as well. In that case, JQuery comes in very handy. There may not be any need to bring a full framework like React or Vue into the scene.
Another situation is when you have to work with popular front-end framework like Bootstrap which depends a lot on JQuery. However, some people argue that Bootstrap is not a justification to use JQuery. But if you already know Bootstrap and want to quickly develop a page, there is nothing wrong in getting the job done with it.
Apart from Bootstrap, several popular plugins like Slick – 9.3% of the top 1 million websites use it – are dependent on this library. If you are using them, you will inevitably come across JQuery.
Basically, you may need to use Jquery if:
- you are working with WordPress or similar content management systems
- the work includes legacy codes or plugins dependent on Jquery
- your app or website targets old browsers also
- you are used to it, and it makes development a lot easier
Now let us see when it may NOT be a good choice.
For User Interfaces & Single Page Apps
One of the main advantage of modern frameworks like Vue is that they have a data layer. That is, you can attach or bind data to the elements on your page. When this data changes, the view also changes automatically. So you don’t need to always access the DOM directly and manipulate it as you do in JQuery. This makes creating complex user interfaces very easy.
So, if you are building complex user interfaces, you should use a framework. Trying to achieve it using vanilla Javascript or JQuery by direct DOM manipulation can quickly go out of hand, resulting in unmanageable code.
Plain Javascript may be better
These days, Javascript have come along way. Browsers come with good support for its APIs. So things once made easier by JQuery are now very much possible without it. Why add an unwanted dependency which only helps in bloating your app?
The website You Might Not Need JQuery has a good list of functionalities in JQuery and their alternatives with plain Javascript.
Conclusion
Is Jquery dead?
No. It is very much alive because lots of websites and plugins still depend on it. But the trend is going down.
Is it a necessity in 2019?
No. JQuery is not a necessity in 2019 because browser support for Javascript is more consistent than ever.
So, should you learn Jquery if you don’t know it?
Yes, especially if you are in a doubt whether to learn it or not. It is a simple and beautiful library without much learning curve. However, give preference to learning the fundamentals of Javascript. Also, if you are looking for certain dev jobs, learning a framework may make you more qualified.
Should you use it even if you know it?
It depends. There is nothing wrong if it makes the work better. But it is wise not to over-depend on it.
So that is what I have found about the whole JQuery vs Frameworks vs Javascript thing. What do you think?