Live data from Hacker News

Gov.uk drops jQuery from their front end

web.dev

301–310 of 458 posts

Re: Gov.uk drops jQuery from their front end

#301

Earlier quoted context omitted.

> But to me, they are like the old grey beard who didn't update his knowledge as the times changed. Maybe it's just me but with all the rampant age discrimination nowadays in tech, I really don't like to see the continued propagation of this stereotype. All sorts of people of all ages are unwilling or unable to update their knowledge of new tech, there is no reason to link this characteristic to someones advanced age…

I sympathize with older devs, my dad is an older software dev. But you kind of do have to be old in order to have outdated knowledge: nobody young is going to learn assembly tricks which worked on MIPS and other past architectures. Older devs and companies not constantly learning new things and updating to best practices is a real phenomenon. On the other hand, anecdotally most older developers actually do keep up to…

Bootcamps such as Hack Reactor (purchased by Galvanize) have curriculum which is basically outdated by 10 years, so you're going to have graduates using var, anonymous self-executing functions as modules that mutate the global scope, and libraries like jQuery and bluebird.

If any student leaves that program with a modern perspective of web dev (such as using Redux or even RTK), it will be due to their own personal grit.

C'est la vie.

Re: Gov.uk drops jQuery from their front end

#302

Everyone here seems to be talking about how great jQuery was for DOM interaction and that's true. But the other thing that was life changing about it was how easy it was to make ajax requests!

But the other thing that was life changing about it was how easy it was to make ajax requests! What's the "modern" alternative to jQuery in that regard? I don't do much JS development, but if I needed to make an AJAX request today, my first instinct would probably still be to use jQuery.

Google the Fetch API.

Re: Gov.uk drops jQuery from their front end

#303

When I first started programming I was pretty lucky to get a job at a games company. My first lead was a veteran who had shipped a lot of AAA titles and he loved his war stories. He was personally interested in performance and he would often cite hardware timings for specific cpu instructions. One story he told a couple of times was about some grey beard who was before his time. The grey beard was once a legend in th…

Speaking of gamedev and jQuery, I work at a company where we basically make games for education purposes, for high profile universities, mostly. The games are all web applications, and we've learned to bend React in each and every direction to best serve our uncommon use case. A few months ago we needed some extra firepower, and offloaded a project to a small team of external consultants. I'm still shocked by what they shipped: the smoothest and juiciest web game I've ever seen, made with the messiest and most ancient clusterf€#k of jQuery I've ever witnessed in existence. The moral of the story to me is: no matter how cool your new shiny tool is, old, battle-tested tools have generated generations of wizards which, given the right scenario, can still bring magic to the table.

Re: Gov.uk drops jQuery from their front end

#304

Earlier quoted context omitted.

HTMLElement.prototype.remove exists everywhere except IE: https://developer.mozilla.org/en-US/docs/Web/API/Element/rem... Also for element creation: Object.assign(document.createElement("div"), { class: "foo", style: "display:none" }); I mean, you normally abstract these things with a helper fn or two, without importing the whole jQuery anyway.

> I mean, you normally abstract these things with a helper fn or two, without importing the whole jQuery anyway. Add enough helper functions are you're at jQuery anyway. Looking at the jQuery source code, it manages a lot of edge cases that I don't really have time to figure out on my own. The DOM API isn't really designed that well for human consumption. https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeTy..…

You need to write a lot of helpers to come close to jQuery. Also edge cases aren't that big of a deal now that IE is near it's EOL.

Re: Gov.uk drops jQuery from their front end

#305

Earlier quoted context omitted.

As a counterpoint, I had a similar conversation with a report of mine about jQuery. He said it was not necessary and you could just use vanilla js. I said while yes that's true as a dev if I told you I needed you to implement a new payment provider for billing would you tightly and directly align with who we used or abstract it away via some wrapper so that if we ever had to change it wouldn't be difficult? Of course…

Yeah that's what I'm afraid of. IE 5.5 diverging from Netscape 4 again. Are we really betting on Microsoft, Google, and Apple not getting into a feature fight again?

They do get into feature fights often. See Apple not adopting PWAs, or IE focusing on blocking 3rd party cookies. But the parts that are covered by jQuery are solved and agreed upon.

Re: Gov.uk drops jQuery from their front end

#306

Earlier quoted context omitted.

HTMLElement.prototype.remove exists everywhere except IE: https://developer.mozilla.org/en-US/docs/Web/API/Element/rem... Also for element creation: Object.assign(document.createElement("div"), { class: "foo", style: "display:none" }); I mean, you normally abstract these things with a helper fn or two, without importing the whole jQuery anyway.

> I mean, you normally abstract these things with a helper fn or two, without importing the whole jQuery anyway. Add enough helper functions are you're at jQuery anyway. Looking at the jQuery source code, it manages a lot of edge cases that I don't really have time to figure out on my own. The DOM API isn't really designed that well for human consumption. https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeTy..…

> Add enough helper functions are you're at jQuery anyway.

I really hate these exaggerations. jQuery is, last I checked, over 200k unminified. Anyone writing enough helper functions to get to a fraction of that is already a pathological case.

Re: Gov.uk drops jQuery from their front end

#307
post #27

Tangential, but sometimes I see people say that jQuery is dead/failed. While it's not as popular anymore, I think that's actually the perfect evolution for it. jQuery was making up for browser API shortcomings, and now many of those shortcomings have been addressed and been incorporated into browser APIs (not everything, but quite a bit).

I really don't get this discourse, jQuery API is much more ergonomic, concise and clearer than the DOM api. Sure you can do it but that doesn't mean you should

Ad hoc manipulation of the DOM contradicts the philosophy of a lot of frameworks, as that is state which is unaccounted for.

Re: Gov.uk drops jQuery from their front end

#308

Earlier quoted context omitted.

> But to me, they are like the old grey beard who didn't update his knowledge as the times changed. Maybe it's just me but with all the rampant age discrimination nowadays in tech, I really don't like to see the continued propagation of this stereotype. All sorts of people of all ages are unwilling or unable to update their knowledge of new tech, there is no reason to link this characteristic to someones advanced age…

This is a fair criticism of how I chose to tell the story. The line you quoted was supposed to refer to the character introduced in the second paragraph and not to a generic stereotype of aged man. I can see how my choice of wording created an implication that people who have grey beards are old and that it is this oldness that contributes to their unwillingness to learn. The familiar cliche of "you can't teach an ol…

I'm curious: what's replaced Query? I guess it's not a single library, but a set of frameworks...

Re: Gov.uk drops jQuery from their front end

#309
post #273

Earlier quoted context omitted.

> guaranteed to outlive jQuery the library There's absolutely no reason to believe that considering those APIs add new features independently of each other. A library like jQuery can serve as an intermediary if browser A implements new feature X that is possible in browser B but through excessive (and slow) DOM manipulation. jQuery can act as a bridge between the time browser A's implementation and browser B's.

There's not much added to the browser that's particularly independent (i.e browser A adds it with browser B having no plan to implement it at all), and when there are APIs that are perhaps newer and not widespread yet, it's usually easier to pull in a specific polyfill (or ponyfill) for that specific feature, rather than rely on one library that's trying to cover everything. Especially as those libraries tend to mimi…

> There's not much added to the browser that's particularly independent (i.e browser A adds it with browser B having no plan to implement it at all)

You haven't seen the privacy nightmare APIs Google is trying to push on web "standards"? The only other two browsers, Firefox and Safari, are not going to implement most of them in the foreseeable future.

Re: Gov.uk drops jQuery from their front end

#310
post #285
post #229

Earlier quoted context omitted.

you could be using it already w/jquery though and if you just switched to the native selector it would stop working everywhere but safari. "#some_combo:has(option:selected[value=..]) + .." seems like a reasonable way to conditionally target something to me, is it terribly worse than some other way?

> is it terribly worse than some other way? Yeah, it's fragile and will easily lead to bugs when someone changes the markup without realizing it's going to break some crazy selector in another part of the code. It would make a lot more sense to just add a class to the element you're trying to select.

it's a conditional select, you're saying just add code to add/remove a class to the target - of course, but that defeats the point of wanting a conditional selector in the first place
Post reply on HN