Hacker News new | ask | show | jobs
by jgalt212 2391 days ago
I'm tired of this comment.

1. Pretty much every website needs JS to function as intended.

2. Delivering fully marked up HTML to the client is a waste of server resources and an under-utilization of 4 GHz client resources.

7 comments

I'm not going to jump on the JS hate-train. I develop for the web, I use JS every day. I like JS, I think it's reasonable for websites to use JS. I think most of the people who hate JS are either misinformed or just angry that the web has made programming accessible to a new generation of non-programmers. Fight me.

But all that said, seriously, a lot of current websites don't require JS to function, and if you use an extension like uMatrix, it's trivial to re-enable it on the sites that do.

I have Javascript disabled by default on my personal computer at home. It's not, like, trivial to use -- you will find a lot of broken websites. I wouldn't turn off JS for my parents. But if you're technically inclined, turning JS off is really, honestly not a problem. You just enable it whenever a page doesn't load.

Most news sites I visit work without JS, it will speed up a number of sites dramatically, and (when combined with a few other settings) it can be a huge privacy increase too. It's worth considering, particularly for portable devices like laptops.

Yeah, I use uBlock along with a pi-hole-style dnsmasq blacklist. When I have to use crude unfiltered internet somewhere I'm rudely shocked by how slow it is to render--and horrible, once it does.
> 2. Delivering fully marked up HTML to the client is a waste of server resources and an under-utilization of 4 GHz client resources.

And this kind of entitlement is why everybody hates the web noawadays and is running adblock on everything.

What executes on MY resources is up to ME--not somebody else.

If what you're doing isn't directly helping ME, burn your own resources.

I don't think it's entitlement. Many free/ad-supported websites are running on very thin margins and sharing the computational burden with the client is not an unreasonable ask.
It is indeed unreasonable to expect me to waste my battery life to run your tracking scripts so you can stalk me against my wishes and without my consent.
"... as intended."

There's the catch. The web developer's intent does not necessarily align with the user's. The developer wants to use Javascript. What does the user want?

The simple example is a website that just delivers information.

The user just wants the information as quickly and easily as possible. She does not care whether Javascript is used to deliver it.

She does care however if the delivery is more resource-intensive and slower.

But if the website requires JS to even load the content, then it doesn't matter what the user's intent is. And it's easy to say "just close the tab" until you really need that content.
It’s also easy to enable it for that one interaction.
This sounds great in theory, but I tried this for a while and got really frustrated at just how often I had to enable JS for a specific site/page because it was broken, sometimes in non-obvious ways (e.g. some interactions work but others rely on JS). For me at least, it wasn't worth it, but YMMV depending on how you use the web and your tolerance for this kind of thing.
Mostly agree with #1, but I don't understand #2. You're saying delivering plain, pre-rendered HTML is too fast for the client, so we shouldn't use it (especially in a thread about energy use on mobile)?
Using JS for partial page updates (whether that's a full single-page app or something smaller) has the potential to consume fewer network resources across multiple interactions.
Has the potential to ... but in practice, no. Websites which do this overwhelmingly use "best practices" frameworks, libraries, packers, minifiers, and up with an extremely dense 1 MiB javascript bundle, while the meaningful html/text of the page is less than 10 KiB. Images are bigger but the need to load / ability to cache is the same in either situation. And be careful that your api responses are not huge json blobs with more information than the page needs ...

Modern webpages use all the latest best techniques, and lose the performance race by miles, over and over again. Nobody is interested or enabled to clean up the mess, just to try to add more big-bang optimizations on top, after we get a few more features which users hate crammed on top ...

The truth is we had the technology for extremely efficient computation 10 years ago. New technology is nice, I like it, but we don't need it. But also, it doesn't matter. Simple gluttony and sloth will overwhelm any efficiency improvements.

> Pretty much every website needs JS to function as intended.

True, but I prefer them to function better than intended.

1. Actually no, most websites work just fine. I have YouTube, Twitter, and Facebook (I know) whitelisted. Pretty much everything else I use regularly is fantastic.

2. The server doesn’t have to run on a battery small enough to put in my pocket.

> Pretty much every website needs JS to function as intended.

Demonstrably untrue.