What do you think about jQuery?

I had a thought today as I was working on a few things, and I would like to know the view from others. Now that we have React, Angular, Vue, etc. What is the possibility that jQuery becomes outdated? I know that word press uses jQuery heavily, and there is no doubt that you could look at older websites and find jQuery in use. Do you think it is possible that a library or framework like react, angular, vue, or possibly another option take jQuery out of the picture?

You’ll here different theories on this.

My theory is that jQ was awesome when it first came out but is now somewhat obsolete. If it wasn’t for WP, both jQ and PHP would (very?) slowly die.

It is still good to learn the basics of jQ. But I don’t recommend diving deeply into it unless you know you will need to work on a jQ site or will be doing WP.

Those are my thoughts, others may disagree.

4 Likes

jQuery served a very important place in the history of javascript, and in fact formed the basis of much of ES6.

When jQuery was developed, John Resig had a very definite plan for it: we were in the middle of the browser wars, each major browser was releasing its own features and language extensions implemented differently, and there was very little consistency. So he came up with an idea of a fairly small, fairly reliable, fairly easy library to bridge that compatibility gap. But the intent was not to have a library we’d rely on indefinitely - rather, it was intended to serve as a interim tool until such time as browsers came to a common base. He saw it coming, and he planned (and hoped) the day would come when jQuery was no longer needed.

That happened. ECMA and the W3C started a unified plan on what javascript was, and how it should be implemented, and browsers that could get on-board with that have thrived.

But the impact of jQuery cannot be understated. Being able to use the CSS selectors within querySelector and querySelectorAll? Thanks to jQuery. Many of the underpinnings of a “unified javascript” come from designs core to jQuery.

Will it go away anytime soon? Not really likely. It could happen, but it would mean a core rewrite of a lot of legacy libraries, of which many of the maintainers have moved on to other things. It works, and it still quietly does its job. It could be done, as I say, but it would require an investment of time and resources that, for many, are being allocated elsewhere.

It is good to be aware of the core jQ library, absolutely. You may find yourself in a shop where you’re having to implement features using jQuery, or where you have to port from jQuery to more modern syntax - without an understanding of that core, it will mean a learning curve.

I do have to disagree with @kevinSmith about PHP though - there are a lot of power-players still happily working with it. It won’t be going away anytime soon. If we still have servers running COBOL to back web sites (?!), I don’t see PHP going anywhere, WP or not. :grin:

2 Likes

I find that to be really interesting. This is just my opinion, but I think the majority of people would not have the mindset of creating something in the hopes that it would not be needed.

1 Like

You say that, and yet when newer technologies come along (things like Web Components, for example), the open source community often comes out with a solution to act as a “shim” or “polyfill”, to act as a bridge between what browsers currently implement and future plans (thinking of Polymer and lit libraries here).

Mozilla will often show new language features in the MDN that some browsers may not implement yet, and then show a polyfill that can be used inline until such time as they do start implementing those features.

It might be more common than you realize. :wink:

1 Like

Jquery has been outdated not by frameworks, but by JavaScript and browser support itself.
The primary reason to use JQuery “back in the day” is it provided a reliable API service to perform specific tasks that would work in all browsers. As a developer you didn’t have to consider all the intricacies of different browsers and JavaScript versions.

Today that issue is more or less not important anymore, as browser standardization has taken hold, and you can rest assured almost every use who could use your site will be using most of the standardized stuff. (with a few exceptions, like IE11 ;D)

Because of that, JQuery’s primary purpose isn’t as necessary anymore. However, due to the prevalence of it in older codebases, it still is out there. From being used on older sites, to some UI components still running “on” JQuery. JQuery isn’t going anywhere anytime soon. As unlike older “legacy” tech, like Flash, JQuery still works.

No, because those 3 frameworks have a different goal entirely than what JQuery’s goal was. If you have a site/system that works and uses JQuery, there isn’t a reason to move to those frameworks. Not only is that a lot of work, but those frameworks are designed to help you build those systems. However, if those systems are already built there isn’t much incentive to move on.

Because of this JQuery wont be “pushed out” now, or possibly ever. It will stick around on older sites, and it would be useful to learn and understand what it can do and why you’d use it. Unlike those other frameworks, JQuery is a library not framework. So learning and using it isn’t as complex as other frameworks.

I’d learn it at a high level, just to understand how you can learn more about it if the time ever came where you have to use it. I wouldn’t go out a build a project with it now though, just skim :slight_smile:

3 Likes

I believe JQ is still the largest JS “library/framework” and I don’t think React, Vue, etc. are even close. Now how much of that is based on WP and legacy systems I could not tell you.

I think JQ has a place and can be good for smaller simpler projects, ones where something like Angular or React might be overkill. That clearly will be at the preference of the individual developer.

Beyond that it kind of just depends on what you do. If you want to be a WP developer you will need to know JQ. If you work for, or aspire to work for a company that has a bunch of legacy code in JQ and JQ is a requirement for the job then obviously you will want to know JQ.

If you want to work of a company that mostly uses React then spend you time on React. Same applies to Angular and really any other framework.

Regarding the question of whether JQ will die. Simple answer: no. As stated in previous posts there is to much legacy code out there and from business perspective you are not going to spend the time and money to migrate everything over to say React when it works just fine how it is. Same applies to PHP or any other language that people will claim is “dying”. Something like 85% of banking software is still coded in COBOL so that should tell something right there.

1 Like

I agree with this,

I work on smaller projects… MVC websites based on php,

On an average project I only write a few hundred lines of javascript, for which setting up and working with React or similar would be total overkill,

jQuery has a very stable and easy to use API and it’s extremely simple to setup and use,

Larger projects will most likely use something like React, Angular or similar,

It really does depend on the project, different tools are more or less suitable for different jobs, I choose jQuery purely for expediency, it’s quick and easy but less maintainable on larger projects… that’s where frameworks with a proper structure would become more useful

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.