Live data from Hacker News

Ask HN: Is jQuery on its way out?

news.ycombinator.com

31–40 of 60 posts

Re: Ask HN: Is jQuery on its way out?

#31

Affirmative. It's not just that there are advanced application frameworks like React and Angular -- it's also that browsers are more standards compliant, and standard APIs have evolved in recent years to cover much of the gap that jQuery once usefully filled.

I made a diagram of the way I think about it here: https://plectica.com/m/ADUNN80H4

When you map it out like this, the answer seems obvious that the place to invest your time is in learning the standards.

Re: Ask HN: Is jQuery on its way out?

#33
Feel free to disregard this advice, I don't do anything in javascript.

Whether or not it's worth becoming good at jQuery is essentially determined by your goals in life, and whether becoming good at jQuery in particular, is in alignment with those goals and also of high importance.

Any time you spend honing one skill is time not spent honing another. You want to be sure to spend your time on the most important things. Figuring out what is important itself becomes a skill to learn.

Pinging HN on whether it's worth learning jQuery is one way to assess importance. But keep in mind, if the people who answer have different goals than you, their answer may not be relevant and may actually be bad advice for your case. This answer included.

Figure out your goals. Find people who have accomplished them. Talk to them directly about what they did and how they did it. Adapt what makes sense to your life.

Finally, be careful of learning something just for the sake of learning. It feels great, but it can actually be procrastination in productivity's clothing. Make sure you are clear on why you are spending the time learning X right now, and be clear on why you are not spending time on learning Y right now.

Re: Ask HN: Is jQuery on its way out?

#34
post #11

Not a perfect analogy, but PHP was on its way out for a while and probably would have gone all the way out -- if it had not been for one very high-profile company that essentially made it usable at scale. And the reason it did so was because even though PHP had little cachet, it was easy to hire PHP devs. Similarly, there are now a lot of things you can achieve with vanilla JS (or even vanilla CSS) that you used to o…

> And the reason it did so was because even though PHP had little cachet, it was easy to hire PHP devs. Really not true. There is no part of the hiring process at FB that focuses on trying to find PHP (or now — Hack) developers. The main impetus was that there was an existing, large, PHP code base. Disclaimer: former FB engineer

Obviously not now. But the choice to start with PHP and not quickly migrate away did have something to do with the fact that it was easy to find people familiar with it, and easy for people not familiar with it to pick it up.

Re: Ask HN: Is jQuery on its way out?

#35
post #16

I think jQuery is still a relevant tool for building dynamic websites—animations, carousels, pop-ins, etc. However, for building SPAs, jQuery has been eclipsed by Angular and React. And thank god for that, jQuery was always an ill-suited tool for the job. Even bad Angular applications are better than good jQuery applications, in my experience.

> I think jQuery is still a relevant tool for building dynamic websites—animations, carousels, pop-ins, etc. I think that vanilla and CSS3 is a better option. Ten years ago there weren't the options. Now all browsers are up to speed and standards compliant there is not the need. It takes less time to learn how to do something properly the vanilla than it does to hack older jQuery code into shape for one's own use cas…

You could take some time to understand jQuery it is not that big or complicated. It might be on its way out, but it will be around long enough to be worth the effort in my opinion.

Re: Ask HN: Is jQuery on its way out?

#36

The best advertisement for jQuery, ironically, is this site: http://youmightnotneedjquery.com/ Look at how simple things are in the left column, and how much more code is needed in the right column. jQuery has many convenience features such as chaining, for example: item.addClass('selected').siblings().removeClass('selected'); and you don't have to check for nulls after each selection. Many functions such as closest(…

That site is from 2012. It defaults to IE9, and the latest version of IE listed is IE10, which was EOLed in 2016. replaceWith() and prepend() are included in Edge 17 (released Apr 2018).

A modern version of youmightnotneedquery with, say, features currently supported by 90%+ browsershare would be even more concise. The AJAX JSON request in the first example, for example, is just:

  fetch('/my/url').then(response => response.json())
The Request example is:

  fetch('/my/url').then(response => ...).catch(error => ...)
The fadeIn example is (CSS3, not JS):

  @keyframes fadeIn {
    from { opacity: 0 }
    to { opacity: 1 }
  }
  #el { animation: fadeIn 1s linear; }
(It gets even easier if you're fading in on hover or other user action, because you can use a CSS transition instead of the animation and then just use .classList.add()).)

Re: Ask HN: Is jQuery on its way out?

#37
There is also the option of using a much smaller, lighter weight library to handle ajax (where the standard based approach still has some limitations) and using standards for everything else.

jQuery was an amazing step forward but it's almost always better to use standards based options and those are now available for much of jQuery's functionality.

Re: Ask HN: Is jQuery on its way out?

#38
> Due to the proliferation of many advanced JS libraries such as React and Angular, do you think jQuery is on its way out?

Absolutely.

> Is becoming good at jQuery a waste of time?

Unless you are going to be maintaining legacy code, yes.

Re: Ask HN: Is jQuery on its way out?

#39
post #26

I think for creating a messy Proof of concept, or creating a simple tool with minimum UI and complexity, I will always be grabbing JQuery. It's just so simple and I've got all of it memorized for so long... Which makes me curious, actually, how basic can you get with Vue and React? I only know the large "boilerplate" versions with Redux and bells and whistles. Anybody prototyping on React/Vue/Angular?

React itself can easily be used as a drop-in much like jQuery, but then you will be using plain Javascript syntax, which is a bit less readable than JSX.

If you're planning to use JSX, you'll need a JSX transpiler and before you know it you're down the Webpack/Babel rabbithole and you get a node_modules folder containing a zillion packages written by a thousand people, of which - statistically speaking - at least a handful will be clinically insane.

But yeah, in principle you can do it (and I have done it).

Post reply on HN