JavaScript Devs: Is It Worth Learning jQuery?

If you’re learning JavaScript and Web development, you might be wondering whether to learn jQuery. After nearly a decade of existence, jQuery has grown into a fundamental part of JavaScript coding in Web development. First, let’s look at why jQuery came to be, and whether it’s still necessary. Then we’ll wrap it up with some conclusions on whether you should learn it.

In the early days of Web development, there were some problems that made coding difficult. First, there was very little compatibility between browsers. Microsoft went off in one direction, and other browser manufacturers went in others. In order to write code that could be called in response to a button click, you had to write several versions for different browsers. That was the first problem.

The second problem was there weren’t any efficient ways to “drill down” into your HTML elements. Say you had an element containing other elements, with those elements containing other elements. To access these elements from JavaScript, you pretty much had to give a unique identifier to each element. What developers needed was a uniform way to assign event code to elements, and a uniform way to access the elements.

Several people attempted to create libraries to help simplify the coding. Of these, a couple quickly rose ahead of the others, and of those, one—jQuery—really took off. Within a few years, jQuery became an essential part of writing Web applications. It was so essential that many of us wished some of the jQuery features were built right into the JavaScript implementations in the browsers.

As browser standards evolved, and as Web developers put pressure on Microsoft to conform to standards, the browsers gradually came together. By the time IE9 was released, browsers were pretty well uniform in how they handled events and accessing elements. We were getting closer to being able to write one piece of JavaScript code and have it run on all the major browsers without modification. (We’re technically still not there, but we’re much closer than we had been.) This meant that writing event code was much easier.

Additionally, the Web standards group (W3C) took note of the way jQuery allows you to drill down into your elements, using a method that essentially matches CSS’s way of naming elements. As such, they added some standard methods for accessing your elements using these same CSS selectors.

And now we’re at a point where many of the missing pieces (and additional features) jQuery filled in are present in browsers. So do you need to learn jQuery anymore?

Let’s look to some of the experts to get their take.

In this article over on SitePoint, Craig Buckler makes the argument that jQuery is just an abstraction. Indeed, he’s correct; jQuery is really just JavaScript code that simplifies your day. Anything you do with jQuery, you can still do without jQuery. And over on another blog, Web development guru Todd Motto presents a line-by-line comparison between jQuery calls and native calls, showing that it’s almost as easy these days just to use native calls.

For example, Motto provides this code in jQuery:

var i = $(“.myclass”);

This searches for all elements on the page that have class name myclass. Now here’s a bit of code without jQuery:

var i = document.querySelectorAll(“.myclass”);

This does the same thing, using a function (querySelectorAll) that’s built into the newer browsers.

If you dig further, you’ll find the same conclusion on other blogs: People are realizing they don’t necessarily need jQuery. Indeed, in my own development work, I’ve noticed over the past year that I’m relying on jQuery less and less.

But before we move on, let’s look at jQuery’s official blog. Here, we see that the jQuery developers have stripped out the code needed for older browsers, resulting in a separate version of jQuery that targets only modern browsers. Because it doesn’t need nearly as much browser-specific code, this modern jQuery library is much smaller in code size than previous versions. To me, that sounds like even more of a justification to abandon jQuery, even if the platform’s developers don’t want us to stop using it.

While a lot of people might argue that we don’t need to learn jQuery, there’s still one big reason for doing so: Legacy code. If you’re going to go to work at a company that already has JavaScript browser code, there’s a strong possibility it has jQuery throughout its code. There’s also a matter of preference: With jQuery, my code is tighter; individual lines of code are shorter. People still like jQuery and its elegance, and they’re going to continue using it, even though they might not have to.

If you’re just starting out in Web development, my suggestion is to learn both jQuery as well as JavaScript’s new, native ways of accomplishing the same tasks. Then decide for yourself if you need jQuery.

Post navigation

10 Responses to “JavaScript Devs: Is It Worth Learning jQuery?”

Many new websites will still continue to be built with JQuery, look at newer frameworks like bootstrap they still utilize this great framework, it’s a decade old but it’s still in good shape and it’s still the most vibrant JS library in the market.

jQuery is simple to learn, even for the newbies. What’s wrong in using jQuery? The only drawback I can see in using jQuery is that your code will be slightly bigger than when not using jQuery. Hence the starting time may be a bit longer when visiting your web page for the first time.

While browser contribute to have varying support for the standards jQuery and Zepto.js have a valuable use in abstracting away the differences. For example the bubbling focusIn and foocusout events are not supported by Firefox but can be used safely with these libraries.

The author did not broach the subject of jQuery-UI (along with third party plugins)
which makes advanced interface objects such as calendars, dialogs, tabs, menus, etc
(for the most part) relatively simple to create and use.

While I haven’t used JQuery in a few years, I don’t regret learning it in the slightest.

Some benefits (in my mind) of learning JQuery:
Gives a good foundation for understanding DOM manipulation without a steep learning curve.
Uses selectors compliant with CSS – as in learning JQuery selectors will help you understand CSS selectors and vice versa.
While the framework ecosystem seems pretty unstable atm, JQuery remains solid and popular.
The plugin ecosystem is second to none.

100% YES and Yes if you’re trying to work as a developer. Even if you don’t use it on some newer dev projects, eventually you’ll find older or simple projects where it makes A LOT of sense to use jQuery for convenience.

While it’s slowly becoming less relevant, it’s still solid for most basic JavaScript uses. And as a beginner it’s a great way to start learning how JavaScript works and the syntax. jQuery is like training wheels for a front end Dev. You gotta start somewhere in JavaScript and you probably will not want to start by attempting to write a fully functioning MEAN stack app written in pure JavaScript right away. It’s best to learn one step at a time.

JQuery is the most mature JS “framework library” available. Its utilities are highly optimized, thoroughly tested, and implemented consistently. Its plugin system provides a rich ecosystem and an elegant mechanism to override default behaviors without changing the core library.

A better question is should you learn Angular? It is now moving to a controversial 2.x series that is not backward compatible. It encourages developers to write PHP-style embedded logic that is very difficult and expensive to test, and it abstracts so much of what is really happening in the browser (“automatic two-way data binding”) that novice developers are blinded to the possibilies outside its myopic philosophy of web applications.

I found it funny at the last HTML 5 developer conference in SF that all the presenters were trying to outdo each other claiming how “little” they used jQuery. The take away? They all use jQuery! That’s because its mature, reliable, easy, noninvasive, and performs very well.

YOUR CAREER. YOUR PATH.

Author Bio

Jeff Cogswell is the author of several tech books including “C++ All-In-One Desk Reference For Dummies,” “C++ Cookbook,” and “Designing Highly Useable Software.” A software engineer for over 20 years, Jeff has written extensively on many different development topics. An expert in C++ and JavaScript, he has experience starting from low-level C development on Linux, up through modern Web development in JavaScript and jQuery, PHP, and ASP.NET MVC.