Live data from Hacker News

Gov.uk drops jQuery from their front end

web.dev

271–280 of 458 posts

Re: Gov.uk drops jQuery from their front end

#271

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…

that crap is solved in a lot of places, jQuery is no longer the only library, and you don't need to support legacy browsers as much anymore, if at all

Companies are getting more security-conscious because of all the hacks and the pain of keeping old browser support is no longer outweighing the risks of upgrading is my theory.

Re: Gov.uk drops jQuery from their front end

#272

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…

> 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. At one time jQuery allowed them to be the hero and "Get Things Done" faster than their competition. But times have changed. Whenever I want to use "vanilla JS" I use jQuery, because I…

Yes as a "greybeard" i noted first that the headline performance gain was 10% & 11% this for a team given far more time and resources to optimize for their goal than most teams or individuals dev. I raised an eyebrow at that

However devs seeking employment should always be prepared to play up to what is trending vs what is appropriate.

Re: Gov.uk drops jQuery from their front end

#273

Earlier quoted context omitted.

jQuery was a useful abstraction when browsers had inconsistent and clunky apis. Modern browsers have apis that are about as convenient as jQuery's, are standard across browsers, consistent with the language, and guaranteed to outlive jQuery the library. Aside from dot-chaining in a monadic sort of way, jQuery offers no benefit to the developer, while costing about 30kB of javascript.

> 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 mimic the API as it is expected to be standardised, rather than implementing a distinct API as jQuery does.

In practice, I'd much rather use the native APIs to do things in the browser than a wrapper library, because I find abstraction from these wrappers tends to get in the way as often as it helps. With modern JavaScript (for-of, the spread operator, far more array functions), it's usually only one or two lines more code to do things the native way, and I find it saves me a lot of complexity down the line.

Re: Gov.uk drops jQuery from their front end

#274

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.

greybeard has always felt like a term of respect to me. personally i think of the type of person who could have been at bell labs in its heydays. definitely could exclude women though.

Re: Gov.uk drops jQuery from their front end

#275
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).

> jQuery was making up for browser API shortcomings While this is true, I can still code circles around frontend developers using vanilla JS. The decline of jQuery is mostly due to the rise of webapp frameworks like React and Vue. But if you are tasked with adding like, a button to a static webpage, jQuery is still the king.

I call bullshit on all accounts. If someone actually tasked you with adding a button to a webpage...

Re: Gov.uk drops jQuery from their front end

#276

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…

Do you see a lot of age discrimination it tech? What I have seen is awkward situations where you have two developers of roughly equal competence. One happens to be 45 and the other 28. Fine, nobody would care about that. Except that due to automatic annual raises, job switches, seniority bumps etc, the 45 year old developer is paid twice as much as the junior. The rational response to this would be to say to align th…

Really? I see 40+ people as diversity hires for the most part. They're there so no one can say the company is ageist. The "good" devs become managers or magically disappear. Magically as in they get banished to some other realm I've never been able to see.

That, to me, says there's plenty of ageism.

If it was as simple as "they ask for too much", then someone would snap them out of it and we'd see plenty of older devs at software companies. Maybe less than younger devs, but plenty anyway.

Honestly, I'd prefer if there were more older engineers to show the younger ones how dumb they are. Maybe better at building dynamic frontends, but dumber. That kind of seniority is sorely missing in software engineering, and it would drive standards upwards rather than downwards as they currently are.

I'm currently in between, and wish I had more mentorship.

Re: Gov.uk drops jQuery from their front end

#277

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.

The meaning of "greybeard" have moved from being literally, to current be figuratively. It doesn't mean that the person is A) old, B) man C) have a beard and D) that the beard is grey.

It simply means someone experienced/being at something for a long time. The greybeards at a company can be all women of the age 26, but if they been with the company for 5 years when the company got started 5 years ago, they are the greybeards of that company.

Might as well say "veteran" or "old-timer", although "old-timer" would imply actual old age, "veteran" implies nothing like that.

Re: Gov.uk drops jQuery from their front end

#278
post #38

Javascript has become so nice, now that browsers support modules. I use a module "dqs.js" for all my query needs. It contains only these two lines: export const dqs = document.querySelector.bind(document); export const dqsA = document.querySelectorAll.bind(document); And use it like this: import { dqsA } from 'lib/dqs.js'; for (const rabbit of dqsA('#rabbits .green')) { ... do something with all green rabbits ... }

I add the parent element to mine const $ = (selector, parent = document) => parent.querySelector(selector); const $$ = (selector, parent = document) => parent.querySelectorAll(selector);

This is the way. In addition to `$` and `$$`, I usually have `$h` for creating elements:

    /**
     * @param {string} name
     * @param {HTMLElement.prototype} props
     * @param {Array} children
     * @return HTMLElement
     */
    function $h(name = 'div', props = {}, children = []) {
        const el = document.createElement(name);
        Object.assign(el, props);
        el.append(...children);
        return el;
    }

Re: Gov.uk drops jQuery from their front end

#279

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…

The part you're leaving out, is that once confronted with the fact that his old easy tricks don't apply, the well-seasoned fellow will draw on his years of experience to provide new tricks to save the day.

I think your portrayal of well-seasoned engineers as the derogatory 'greybeard' with a 'bag of tricks' and a hero complex -- glosses over the fact that many of these men and women have real hands-on experience with a multitude of technologies spanning decades, and in my mind there's real value / leadership qualities associated with individuals companies can rely on to just "get things done" in a pinch.

Re: Gov.uk drops jQuery from their front end

#280

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…

> 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 date with the latest best practices. And there are lots of decades-old frameworks which aren’t obsolete: lots of people greenfield projects with C++ and Spring Boot and .NET, and unless I’m mistaken the C ABI and system calls haven’t changed much over the past ~40 years. So it's not like being old automatically means or even really suggests you're going to use worse, outdated techniques.

Post reply on HN