Live data from Hacker News

Tell HN: Thank you for not redesigning Hacker News

news.ycombinator.com

331–340 of 398 posts

Re: Tell HN: Thank you for not redesigning Hacker News

#331
post #275

Earlier quoted context omitted.

As parent comments mention, sending back the whole-page response when you vote on a comment is a great idea if you have JavaScript disabled or aren't logged in. But it'd be a quick performance win if it didn't do that when you were logged in with JavaScript enabled. The actual JavaScript part of this is actually already implemented -- that's why the page doesn't refresh when you upvote my comment -- so you'd just nee…

Exactly, and it even adds up quickly for a single user in common cases like voting on a bunch of comments while reading a thread. If someone loads this thread right now, the initial page load is 61KB (gzipped). If they read down the thread and vote on 30 comments while they're doing it, they transfer an additional 480KB (16KB/vote [1]). There's no reason that they should be receiving 8x more data by voting on a relat…

From what i can see, the response only contains the comment you upvoted and its children. It's important for people like me who don't have Javascript, but the JS voting system could probably do with a simple HEAD request.

Re: Tell HN: Thank you for not redesigning Hacker News

#332
post #57

HN is lightweight in some ways, but also quite bad in others. For example, every single time you vote on anything, the site sends back a 302 redirect and then a copy of the entire page's HTML in response. This means that every vote results in a response that's usually around 10KB gzipped. As of right now, for me, voting on any comment in this thread currently causes a 14KB response and takes about 1.3 seconds to fini…

From my experience when something like that happens, i.e., HackerNews sends back 10K after an upvote, there is a reason for that. We might not know the reason, but the developer who did that had one and at the time it was probably a good and valid reason (and might still be).

Re: Tell HN: Thank you for not redesigning Hacker News

#333
post #304

Earlier quoted context omitted.

When reading on an iPad, tapping on links is nearly impossible. A better responsive CSS file wouldn't make the site any slower or degrade the experience for laptop users.

I had the same issue on mobile. Annoyed me so much, I made a browser extension that increases the padding around those and the collapse buttons. Not useful for you, but for anyone using Firefox for Android, see here: https://addons.mozilla.org/en-GB/firefox/addon/sihn/ (It could use some tweaks to keep everything aligned, but the small usability tweak was most important to me.)

Thank you for this! Just installed and a quick smoke test provided a much nicer experience for me. :)

Re: Tell HN: Thank you for not redesigning Hacker News

#334

Earlier quoted context omitted.

I assume you have JavaScript disabled, right? If so, can you give an example of a similar webpage that doesn’t reload the whole page to reflect your vote?

No this is about JS enabled. It's the same endpoint. Open dev console and have a look.

I can confirm. Just upvoted your comment with JavaScript enabled, still has 10 KiB transfer.

Re: Tell HN: Thank you for not redesigning Hacker News

#335

Earlier quoted context omitted.

> would be cached For heavy users of the site, sure. For someone who has stopped by for the first time, well, good luck with customer acquisition is all I can say.

Something tells me that YC isn't about acquiring users to have a unicorn exit of HackerNews.

Shitting on users is bad no matter what site you make.

Re: Tell HN: Thank you for not redesigning Hacker News

#336

HN really needs a dark mode. Anyone mentioned it yet? Also: yall ever hear about that syndrome that originated in Stockholm? This site obviously needs a lot of work

Dark mode would be pretty nice, negative colors on my phone works I guess but it'd be nice to have real support.

Re: Tell HN: Thank you for not redesigning Hacker News

#337
post #152

Earlier quoted context omitted.

Sure, of course it can be much worse, and almost all other sites are. I'm just saying that HN could do it better, because there's no need for it to send a redirect or that full-page response unless the user has JS disabled. With JS, they could send a completely empty HTTP 200 response and it would work exactly the same (it does nothing with the response anyway). Right now HN is probably sending multiple gigabytes wor…

>almost all other sites are. That's their point. You're not wrong, you can always be better, but HN is barebones compared to almost all (using the mathematical definition...alright, facetiously using it) other sites.

True. And I can see that some webs gradually stop working if you are using JS blockers. For example Aliexpress used to work fine with uMatrix. Now, if I click on the Next page in the paginator, it behaves like it loaded the next page, jumps to top, but it didn't - it just changed URL location. So I have to CTRL+R to reload the whole page to force their server-side rendering. I know it is theoretically my problem but I have to use JS blocking to stop (for me useless) ads and malware scripts. If they just loaded content from their domain or sub-domains, it would work perfectly fine. And if it were old-school server-rendered website, it would probably work faster, as it was discussed here some time ago. I have a feeling that web devs are sometimes over-engineering it. Web browser is HTML viewer, not an operating system.

Re: Tell HN: Thank you for not redesigning Hacker News

#338

You can redesign the website using modern technology and still make it insanely fast, probably even faster than its current state.

here are some ideas, hope you could find some of them useful:

https://2019.jsconf.eu/news/how-we-built-the-fastest-confere...

Re: Tell HN: Thank you for not redesigning Hacker News

#339
post #332
post #57

HN is lightweight in some ways, but also quite bad in others. For example, every single time you vote on anything, the site sends back a 302 redirect and then a copy of the entire page's HTML in response. This means that every vote results in a response that's usually around 10KB gzipped. As of right now, for me, voting on any comment in this thread currently causes a 14KB response and takes about 1.3 seconds to fini…

From my experience when something like that happens, i.e., HackerNews sends back 10K after an upvote, there is a reason for that. We might not know the reason, but the developer who did that had one and at the time it was probably a good and valid reason (and might still be).

>We might not know the reason, but the developer who did that had one and at the time it was probably a good and valid reason (and might still be).

People seem to assume every aspect of this forum has some brilliant, purposefully elegant rationale behind it, but the truth is PG designed the language (and the forum) to be experimented with and iterated upon, and likely didn't intend the forum to be considered "finished." This software isn't a masters' thesis, it's a proof of concept for a web application in Arc lisp.

Unfortunately, a cargo cult mentality has kind of grown up around this forum and every aspect of it is treated as sacred and not to be touched because "there must be a reason for it." The reason is probably that PG didn't care enough to iterate on the first working solution he came up with.

Re: Tell HN: Thank you for not redesigning Hacker News

#340
post #315

Earlier quoted context omitted.

Sending the same reply regardless of whether the user is using Js or not is not a feature. It's lazy. You wouldn't even need to change a single thing about the front end to fix this on the back end, since the js request via Ajax already has an additional header field ( x-sent-via: Xmlhttprequest or something along the lines). This might be as simple as wrapping output generation in a single if-statement.

> the js request via Ajax already has an additional header field No, X-Requested-With is a non-standard header set by frameworks like jQuery. But it’s trivial to set something like that with either XHR or fetch.

Thanks for the heads up. The only time I came in contact with actual web dev was indeed jQuery, and the couple other times I looked at the dev tools might have been pages using it as well.
Post reply on HN