Hacker News new | ask | show | jobs
by paxys 1129 days ago
> Most websites are about delivering and exploring content. HTML is amazing for this, and you don't need JavaScript.

This is the fundamental misconception that most "get off my lawn" people like the author have, which leads to a variant of this exact post getting voted to the top here every single day.

The web is not about delivering big blobs of text and images. It may have been at one point, but we are far beyond that. Instead:

1. The web is now first and foremost an application delivery platform. The web browser is an OS. The website is an executable program.

2. The web is not a niche hobby for nerds like it was "back in the day", but a $15+ trillion global business.

The sooner you can accept both of these, the more sense everything will make. What you did as an early adopter of the internet 30 years ago is irrelevant. You are not getting that time back. The party is long over, and everything is only going to get more commercial as time goes on.

5 comments

I don't know, when I think about the majority of the sites I visit daily, it's pretty much just content. Like, let's see:

- Stack Overflow

- Hacker News

- Reddit

- Youtube

- Various news blogs

- Gmail

- Shopping/Amazon

- Maps

With the exception of maps, pretty much all of that would be perfectly fine server side rendered (and a lot is, I think). Even gmail would be fine that way, tbh I find it kind of annoying that things like the back button work in unexpected ways.

Things I don't do often but which would be fine server side even though they're SPAs:

- Taxes. Turbotax is very smooth and fancy, but frankly if it gets my taxes done quickly I just don't care that much.

Stuff that's heavy in JS, but which is pretty far weighted content-wise:

- Twitter

- Facebook

- Instagram

Also, a lot of the things that are essentially "web apps" I end up using the desktop/electron version anyway, like Slack or VSCode.

I really think most sites would be better if JS was kept to the bare minimum. The things that actually act like applications often end up with a desktop electron version anyway.

None of these sites on your list would be operable without JavaScript, even with reduced functionality. Heck Hacker News, probably the gold standard for simple websites, would itself be unusable. You wouldn't even be able to get the upvote/downvote buttons to work.
> Heck Hacker News, probably the gold standard for simple websites, would itself be unusable. You wouldn't even be able to get the upvote/downvote buttons to work.

Hacker News upvote/downvote buttons work without Javascript

I was under the impression that a few versions ago, links got a "ping" feature. Having an upvote icon become a link with a "/#" href would keep it from refreshing, and the ping would send data about the vote.

I'm not entirely sure that sort of feature requires javascript at all.

It wasn't sait _without_ but with _reduced_ JS.

JS is fine for dynamic contents (likes, upvotes) but the rest of the page can be completely static...

Do you really need to see likes being updated in realtime? Or infinite scrolling (instead of sane pagination)?

That's why I said a minimum of JS, not none. You don't need 500KB of frameworks for an upvote button
This is true.

But applications can be small and performant.

It takes skill, time, and work; a hard sell, these days.

Nowadays, we can throw together two or three massive dependencies, and get a really high-tone app.

That waddles like an overfed walrus.

I think it's worth asking why, which I guess is less fun than complaining. Are the frameworks too fat? Do they encourage wasteful network requests? Are things not being compressed? Do developers not understand how to incrementally ask for data?
Part of it is the obsession with SPAs. If your site is an application, it makes sense to ship a javascript blob to the browser and have that render everything. But 90% of websites aren’t apps. They’re news sites. They’re blogs. They’re project pages on GitHub or npm.

I think the frameworks are mostly so obsessed with the problem of complex applications that they miss having good support for the simple case of server rendering with little-to-no javascript in the browser. If your website looks like a blog, it will work better if the server ships html to the browser. And maybe, only html. Web browsers handle html really well.

Because you can make content websites using hundreds of kilobytes of react, people do because that’s what they learned at their coding bootcamp. React lets you do server side rendering, but it’s seen as some advanced feature, not as the default for how we should be building the web. (In fairness, SSR is quite complex if you also want to re-hydrate in the browser).

Most websites should be using tools which do server rendering by default.

"Most websites should be using tools which do server rendering by default. "

Meaning the server sends html, or the server sends an image?

edit: html, at least with react

Yes, HTML.

HTML is faster to load on all devices, usually smaller over the wire, trivially cacheable at every level. Its easier to debug, easier to archive or backup, and it plays nicely with screen readers, search engines and reader mode. The back button always works and does what the user expects. And it looks web-native everywhere.

I wrote a 9000 word blog post a couple years ago covered in diagrams. The page renders near-instantly on all browsers I've tried, and scrolling is buttery smooth. How did I do that? Its simple. When users open the webpage, I send them an HTML file.

Everything's downstream from the incentives. What kind of users do you attract by making your website faster/more efficient? People who can't afford a new phone, and whiny boomer nerds. Both of those demographics are more trouble than they're worth.
Speaking as a "whiny boomer nerd," I can say that another demographic is people that need the types of services we provide, and can't afford squat, because they are destitute, physically or mentally challenged, rebuilding shattered lives, or dealing with serious IRL challenges.

That's the demographic that this "whiny boomer nerd" Serves, and they matter to me. I'm quite aware that many non-whiny-boomer-nerds feel as if these people should not exist, but they do exist, and mass murder is not an option, so some of us whiny boomer nerds actually care enough to try helping them.

Also, it's kinda fun, helping folks that can't make non-whiny-boomer-nerds rich, simply because it upsets non-whiny-boomer-nerds to see these “not worth the trouble” folks experiencing better Quality, Security, and performance, than the non-whiny-boomer-nerds do.

I know that it’s kind of immature, but I've always had a bit of a rebellious streak, and I’m easily amused.

I don't agree.

Apart from a couple of really big websites the vast majority of the remaining ones could easily be a static website. course we ended up in dumbed down version of reality where people can't do without Facebook / Instagram so instead of having public information you have to go to a Facebook fan page or Instagram profile...

That’s right. It’s futile to fight the battle of “the web should never have changed after year X” where year X happens to be when you first got interested in the web.
Amen.