Live data from Hacker News

Gov.uk drops jQuery from their front end

web.dev

421–430 of 458 posts

Re: Gov.uk drops jQuery from their front end

#421

Earlier quoted context omitted.

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…

That doesn't answer the question. The ambiguity remains, and so does the question.

Re: Gov.uk drops jQuery from their front end

#422

Earlier quoted context omitted.

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

I think that the improved vanilla js is now "satisficing" for more people. Their threshold of ergonomic usability has been achieved and they stop looking: https://en.wikipedia.org/wiki/Satisficing

or the curse of being good enough. Good concept! :)

Re: Gov.uk drops jQuery from their front end

#423
post #221

Earlier quoted context omitted.

Creating an array, populating it with however many elements just to be able to call some methods and destroying it immediately afterwards. And doing it all over the app, just because it's syntactically convenient. (all while you already have an iterable collection in the form of NodeList)

It is a bit weird to consume an iterator into an array when a NodeList is already iterable. Not sure why it caught on.

I'm also one of those guys that will always spread NodeLists (and other iterable-but-not-array type of objects) but it's really only because I find functional style a lot more readable than imperative style for loops. It might be iterable, but if it doesn't have map/filter/reduce and friends, might as well not be for me.

Re: Gov.uk drops jQuery from their front end

#424
post #385

Earlier quoted context omitted.

>Would you be better off to use a modern javascript variant and stuff like react instead? You also absolutely would. Why?

Because jQuery was written to paper over limitations in ancient browsers that no longer exist, and modern (es6+) vanilla js is actually quite good. One of the primary reasons jQuery was invented is not relevant today. It’s still good software, but I’d say the same about the Perl lwp library yet you don’t see people using it.

Cross browser compatibility was just one of the reasons for jQuery's success. But lots of other competing libraries offered it too at the time. That was the bare minimum a library had to do.

The reason jQuery was so successful, is still so widely used and was instrumental in fomenting HTML5 and killing Flash was its API. Nothing has come close to it in terseness, elegance and power.

Just skim this thread for examples.

Re: Gov.uk drops jQuery from their front end

#425
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…

Mootools, Prototype, all offered cross browser compatibility.

The reason we're not discussing them today is that jQuery has a stupendous API that simply hasn't been matched yet.

Re: Gov.uk drops jQuery from their front end

#426
post #419
post #99

Earlier quoted context omitted.

Animated collapsible div can be done with 0 line of JS. https://code-boxx.com/expand-collapse-div-css-only/

Uhh, did you check out how that actually functions? It looks like garbage.

Agreed, this example looks like total shit.

Re: Gov.uk drops jQuery from their front end

#427

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 was writing websites before jQuery existed, during the reign of jQuery and still today

Can I ask you about your current webstack?

Re: Gov.uk drops jQuery from their front end

#429
post #417

Earlier quoted context omitted.

Browsing the source of jQuery and I don't find it bloated but I find a lot of knowledge in there that a naive user the DOM API would most likely know about. It's kind of like how you can comparing languages using simple example code isn't relevant because proper code with full error handling and edge case handling can be very different from a naive example.

That's not the point. The point is that this is a strawman. "Enough helper functions" to get to jQuery is 288580 bytes. A quarter of that, or even a tenth of that, is already a pathological case and way beyond almost every case of "jQuery substitution" that would happen in practice.

I could read and understand the entire jQuery source code in a single afternoon -- it's not that big. Even in the few minutes I spent reading it, I learned a few things I didn't know.

The worst thing about the web as a platform is the need to count bytes.

Post reply on HN