Earlier quoted context omitted.
> Who cares if it's a bit more code Well, Gov.uk for one, as per the article you're commenting on. As they pointed out: > Not everyone is tapping away on their 2022 MacBook Pro on a rip-roarin' broadband connection. GOV.UK has to be accessible to everyone, and that means keepin' it lean. > Here's a few of the greatest hits from Matt Hobbs on what GOV.UK noticed in removing jQuery: > - Less front end processing time o…
Yes, but that's a government site that's got an explicitly universal audience and is also pretty lightweight already. If you're making a game, say, you may (may!) not care if Edna can't load it on a 1993 iMac, and you might be loading 40MB of resources, so another 24kB is not your pressing problem. Engineering effort is always in short supply, and it is very expensive. Use it wisely. Sweeping judgements gleaned from…
Gov.uk drops jQuery from their front end
441–450 of 458 posts
Re: Gov.uk drops jQuery from their front end
#442Earlier quoted context omitted.
> 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 t…
> Who cares if it's a bit more code Well, Gov.uk for one, as per the article you're commenting on. As they pointed out: > Not everyone is tapping away on their 2022 MacBook Pro on a rip-roarin' broadband connection. GOV.UK has to be accessible to everyone, and that means keepin' it lean. > Here's a few of the greatest hits from Matt Hobbs on what GOV.UK noticed in removing jQuery: > - Less front end processing time o…
Re: Gov.uk drops jQuery from their front end
#443Earlier quoted context omitted.
> 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 t…
> > 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. I'm not sure I follow. It reads to me like the original commenter is arguing that jQuery supporters have out-of-date knowledge. What's the strawman? j…
> his knowledge
Women are programmers too, and there are older ones out there maybe shaking their head at this type of judgement.
Re: Gov.uk drops jQuery from their front end
#444Earlier quoted context omitted.
I believe it's kind of sad that in the days of 2 TB USB sticks that 32kb matter.
Our product is used by all sorts of devices and resources. Many use it on super old hardware in different countries. 32kb isn't much, but when you're analyzing Time To Render metrics, you might be surprised how little is necessary to move the needle. That said I don't expect a massive impact from this change, but removing unused code is going in the right direction.
And then on top of each restaurant app, you also have Uber Eats, Door Dash, etc., which again, basically so the same thing.
There should really be a single fast food app, I select my restaurant, and it shows me the options (which is basically google maps with mobile websites that would actually work). There's no reason for every restaurant and delivery service to have their own app.
Re: Gov.uk drops jQuery from their front end
#445Earlier quoted context omitted.
I don't like jQuery -- I mean I use it but it doesn't occupy enough brain space to even have a strong opinion on it either way. If I took jQuery out then I'd have to care more because would need to re-implement all the pieces of jQuery that my projects already use. Is that going to be 280k worth? No. Is going to be a couple of one-liners? No, because jQuery hides a lot of complexity under it's relatively simple API t…
Alright, we seem to be talking past each other. Maybe that's the sign this is not a productive discussion. I'm not calling jQuery is bloated or difficult to read, nor I am telling anyone they should count bytes. > Is going to be a couple of one-liners? No, because jQuery hides a lot of complexity under it's relatively simple API that take a lot of JavaScript to reproduce. > It's not crazy that to accomplish what jQue…
The argument against jQuery is thus an argument against libraries in general. Why include any dependency that you only use a small part of? You can always implement anything yourself.
The counting bytes comment is because the web, as a platform, is very size-conscious. Rarely does anyone complain about the size of libc and how, since they only use file functions, that should just call into the Linux kernel directly.
Would we even by having this discussion if you could just tree-shake out all the parts of jQuery that you never use at build time?
Re: Gov.uk drops jQuery from their front end
#446Can someone ELI5 what's wrong with jQuery? People complain about 30 kilobytes jQuery consumes. But at the same time their 5mb minified react babellized gulped uglified webpacked blob is alright to load. Is there anything else that is missing?
I've done work using jQuery and several of the modern stacks and maintain much of it today. When I have to dive back into this work the jQuery stuff is usually painless. The Angular/React/etc. stuff causes an internal groan; even weeks after 'finishing' one of the latter some significant fraction of the tools and libraries are obsolete and the first thing you find yourself squandering time on is nursing it all into shape again. Years later you're also faced with either clinging to the old idioms that have been supplanted by 'better' ones or reworking a bunch of stuff. jQuery has never inflicted this problem on me.
Also, I don't really buy the "you might not need it" argument. jQuery reduces cognitive load by normalizing most of what you need to do to a vanishingly small and less error prone API. There is real value in that. jQuery delivers far more than just backfilling.
While I have a hard time imagining a client in 2022 that is so anemic that the cost of jQuery actually matters, it appears gov.uk has convinced itself that the removal of jQuery is a triumph for their use case. I've never had to deal with that use case. I doubt most people have or ever will. And so I take all of this with an appropriate grain of salt; if it's a choice between productivity and shaving a few points in blocking percentiles I'll take the former every day and twice on Sunday and the people that pay me are grateful that I do.
I learned about htmx in the comments of this discussion. I'm definitely going to give that a spin at some point. Thank you HN.
Re: Gov.uk drops jQuery from their front end
#447Earlier quoted context omitted.
Fetch is fine but I'm not going to write document.querySelector every time I have to select some nodes, which happens quite often.
That's fine, pretty sure browsers alias $ and $$ to querySelector and querySelectorAll already (although I could be very wrong) But speaking as someone who writes vanilla by default, it really really isn't as big an issue as you think it is.
You are wrong.
Re: Gov.uk drops jQuery from their front end
#448Earlier quoted context omitted.
> Who cares if it's a bit more code Well, Gov.uk for one, as per the article you're commenting on. As they pointed out: > Not everyone is tapping away on their 2022 MacBook Pro on a rip-roarin' broadband connection. GOV.UK has to be accessible to everyone, and that means keepin' it lean. > Here's a few of the greatest hits from Matt Hobbs on what GOV.UK noticed in removing jQuery: > - Less front end processing time o…
At what point did it cease to matter, though? Can anyone provide information on how many computers, world-wide if that's what we're shooting for, pre-date the mid 2010s? Because, after that, all those computers are plenty fast. Again, this particular library isn't growing much in computational demand. As for the bandwidth, let's assume the worst case is 128Kbps. jquery 3.6.0.min is 88KB. That's about a 6 second downl…
Re: Gov.uk drops jQuery from their front end
#449Earlier quoted context omitted.
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.
I'm not talking about browser edge cases, I'm talking about API edge cases. The DOM API is not very human-friendly.
The DOM is at least very, very well documented. jQuery has documentation, but it's not even close. It gives away what jQuery always has been, which is a library that is aimed mainly at assisting bag-of-tricks StackOverflow programmers than people who actually want to understand their programs and the object graph they work on.
Re: Gov.uk drops jQuery from their front end
#450Earlier 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
jQuery emerged from the market and it's pretty close to what developers wanted to express. JS is design by a committee full of people afraid to come out as "not-as-kind" and completely detached from reality. True, doing some of the things which were half an hour on stack overflow or 1 line of jQuery became a couple of lines of vanilla JS but the API is still pretty awful. Think about XHR > fetch vs $.get or $.post I…