Live data from Hacker News

Gov.uk drops jQuery from their front end

web.dev

311–320 of 458 posts

Re: Gov.uk drops jQuery from their front end

#311

Earlier quoted context omitted.

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 gr…

Can't speak for Hack Reactor, but your generalization of "bootcamps like" is wrong. Went to a bootcamp in 2016 and was doing React/Redux on the front end.

Re: Gov.uk drops jQuery from their front end

#312

Earlier quoted context omitted.

It was just a reference to the person in the story, not an allusion to "because he was old he didn't try to update his knowledge/continue learning".

So why describe him as a "greybeard" then? It are you claiming to have met many younger and/or female 'greybeards'? If your answer is that 'it's just part of the story'. Well that's precisely the complaint.

Because it communicates a well understood idea. It is great that we as a society are becoming more conscious about the way we speak, but I feel like your complaints here are aimed anyone who isn't achieving the proper level of 'purity'.

Re: Gov.uk drops jQuery from their front end

#313
post #302

Earlier quoted context omitted.

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.

Thanks!

Re: Gov.uk drops jQuery from their front end

#314

Earlier quoted context omitted.

When you are dealing with less than 5 "interactive things", jQuery is awesome... beyond that it might be better to consider a front-end framework. Jr devs have the tendency then to discard jquery because "is old" not because it isn't working anymore.

Though for that little work, I'd rather have a small local library that implements what I need over standard DOM & JS parts instead of the full weight of jQuery. Unless of course I need to support legacy browsers, then jQ is a no-brainer - that crap is solved there and I don't want to have to deal with it myself. And while jQ is large compared to my little home-grown set of wrappers, it is small compared to all the o…

There are tools like babel (even typescript) which can help you support older browsers.

Re: Gov.uk drops jQuery from their front end

#315
post #226

Earlier quoted context omitted.

As somwone who constantly replaces jquey with vanilla js the difference is more like two lines of jquery against 3 lines of vannila js. One line more. But you have one dependency less, which is quite beneficial

Update: fixed formatting A lot of times the jQuery syntax is easier to understand (IMO). Remove element exmample: jQuery API: $('.element').remove() DOM API: document.querySelector('.element').parentNode.removeChild(document.querySelector('.element')) or if you want to introduce another variable just to remove the element: const child = document.querySelector('.element'); child.parentNode.removeChild(child); Create e…

Or you could just do document.querySelector('.element').remove()

Re: Gov.uk drops jQuery from their front end

#316

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 think of this story whenever I see jQuery popup on Hacker News. There is always a strong contingent of devs who swear by this library. But to me, they are like the old grey beard who didn't update his knowledge as the times changed.

This is a strawman argument. It's a biased view you hold. Because of that, you make up a story to match your biases around people who use such-and-such library don't think they need to update their skill set. I'm not angry about this, but am only pointing out biased arguments create dissonance.

> I see a trend of well-written, evidence backed articles where large, well funded sites are making a case to deprecate jQuery. These fact-based investigations into problems faced by their dev team result in a reasoned decision to remove a dependency that no longer justifies its cost. I encourage everyone to introspect if their defense of jQuery is on an equal technical footing to these types of investigations.

You read something somewhere about how jQuery is a costly dependency. Yet, there are no links that I can see anywhere in the threads here, nor a good rational argument for people to NOT use jQuery because it is a costly dependency. There are opposing opinions on this, but the opinions that it needs to be included via CDN don't address the fact it can be hosted locally and the opinions "who needs all that code to load?" don't take into account that browsers and networks are bonkers fast nowadays. Who cares if it's a bit more code? It's not like jQuery is growing its codebase at the rate compute and network speed increases.

For that matter, could not the same argument be made of JavaScript itself? I taught myself Promises, not because I could stay "relevant", but because it makes good sense to write code that is easy to read and maintain, even if it is me doing both on my project. The code I produced when I wasn't doing Promises was "legacy" the second it hit the repo, and will be "costly" if someone else has to jump in and work on it to convert it to Promises, because they'll have to brain dump what I was thinking (or not) when I wrote it!

This salt and pepper beard stays up on technology. I didn't really write code in the past, but now I'm great at what I do and I fully intend on exploring new technologies when they compliment what I can do rapidly in the frameworks and methods I well understand, if that's what it takes to get to market faster.

Re: Gov.uk drops jQuery from their front end

#317

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…

when you say veteran do u actually mean veteran of a real life combat war who later joined the games industry or veteran of the games industry

You know "veteran" does mean "someone with a lot of experience in something", right? In non-US countries that's even the primary meaning.

https://dictionary.cambridge.org/dictionary/english/veteran, https://www.oxfordlearnersdictionaries.com/definition/englis... both give its primary meaning as "a person who has had a lot of experience of a particular activity" or similar. Even Wikipedia gives the generic definition first, and clarifies the more specific case as "military veteran".

Re: Gov.uk drops jQuery from their front end

#318

Earlier quoted context omitted.

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 gr…

Can't speak for Hack Reactor, but your generalization of "bootcamps like" is wrong. Went to a bootcamp in 2016 and was doing React/Redux on the front end.

> Bootcamps such as Hack Reactor (purchased by Galvanize)

No, this generalization is quite correct. If you went to a bootcamp which was not such as Hack Reactor, then perhaps you may wish to promote the program by name and discuss your experience there.

Re: Gov.uk drops jQuery from their front end

#319
post #241

Earlier quoted context omitted.

Amusingly, I always joke that I'm fluent in jQuery, but no absolutely no javascript. As a mostly backend go/python/non-javascript developer that has always held true. It is just a tool in the belt for an engineer. Can you use jQuery in 2022 or later to solve really amazing problems that impact user experience? You sure can! Would you be better off to use a modern javascript variant and stuff like react instead? You a…

While I think that’s the right choice, I’d just like to point out that the problem with jQuery today is it was a library built to smooth over and fix differences between browser JavaScript engines (IE, well, IE). Over the past 15 years or so browser JavaScript engines, except at the extreme edges, are roughly comparable. Further, a lot of the features of jQuery have been adopted into standard JavaScript. So, the reas…

> smooth over and fix differences between browser JavaScript engines

And let us avoid some of the extremely verbose and un-ergonomic standard APIs.

Re: Gov.uk drops jQuery from their front end

#320

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…

I'm nearing 40 and I've seen a bit of both. By far the best teams I've worked in had a healthy mixture of experienced developers and younger ones, although I'd say the main catalyst was a mentoring mentality where everyone, young and old, was encouraged to share their experiences (especially the bad ones) in an attempt to brainstorm/crowdsource an improvement to the status quo.

I've also seen the opposite of what you'd expect: a young startup with a very young team that functioned on outdated practices and tools. My first contact with their codebase was a shock to the system – a mishmash of competing coding styles and conventions, barely any of them a best practice, much of it not very idiomatic, an alarming lack of consistency. The choice of tools, libraries and frameworks was (by startup standards) definitely not best in class, and where good choices had been made, the joy was short lived by realisation that they were on old versions, or not using their tooling properly.

But, anecdotes aside, there's a point that generally gets overlooked. Best practices and good developer experience are the result of intentional choices, often in retrospect. The only way to come up with best practices or to improve DX is through experience -- especially poor experiences. I mean, who would've thought that experience was an asset.

Post reply on HN