Is jQuery Still Good?
jQuery works as well as it ever did today but a whole lot of its use cases have been replaced either by native JS functionality or newer, more specialized libraries. Back when I first began web development around 2014/15 jQuery contained a whole lot of functionality that was pretty critical to a new website or webapp. It was used for making asynchronous calls to external APIs, it had better selectors than normal JS getElementById/Class, it had a weird early form of promises, it was even able to handle basic animations if I remember right.
Basically it patched in almost all of the functionality we needed but didn't get from vanilla JS in one library (especially since it was often safer to use jQuery than vanilla JS due to differences between browsers making it likely vanilla JS code behaved differently between browser). It was pretty much an auto-include (along with underscore if you were fancy).
Nowadays it still works but there are a couple reasons it isn't the swiss army knife everyone uses for everything.
1) To speed up their apps by relying on smaller dependencies than jQuery. There are lots of popular, more specialized, smaller libraries that perform the same functions jQuery used to (some would say they do it better but thats more subjective). Since jQuery did everything it needed to include lots and lots of code to implement all its functions, this made the library quite large. For reference, Vue (a popular library used for templating and organizing code today) is 33.3KB compared to jQuery's 214.09 KB. Something like Vue is simply a lot smaller and quicker to download than a dependency like jQuery, especially when you consider that since jQuery does a million things you're probably spending time downloading code you aren't actually using.
2) It leads to code that isn't quite as organized as code written using a modern framework. This is a bit subjective but back in the day when jQuery was used for everything it was really on the programmer to organize their code logically. Its not that ALL jQuery dependent js relies on hundreds of lines of pyramid code but a whole lot was. This made it pretty difficult to read js files written at the time, especially as complicated webapp logic became more common and the community at large was not yet proficient at organizing it. These days, popular frameworks (whether you love them or hate them) force structure on your code. For example, if you know what a React Component is you can look at each React Component in a project and not have to wonder what the purpose of all that code is. By contrast, jQuery merely provided you the means to update the UI and make AJAX calls and counted on the programmer to make the actual purpose of the code clear.
3) Its older, isn't as "cool", and doesn't give new programmers many good reasons to learn it in a world where there are other options.
tldr; jQuery is big, less organized, and generally less desirable than modern alternatives.
All that said it isn't BAD to know jQuery. It still performs its function, parts of it can still be useful, and I'm sure a lot of "older" JS is filled with it so for some devs its very important to understand it to this day. I just wouldn't rely too heavily on it with all the other options we have today.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now