Live data from Hacker News

Tell HN: Thank you for not redesigning Hacker News

news.ycombinator.com

291–300 of 398 posts

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

#291
post #147

Earlier quoted context omitted.

Okay quick thought exercise. HN doesn't use a react framework and is quite lightweight on clientside JavaScript. How many upvotes does it take using this system before the total data size transmitted (original page + modifications) is, in sum total, larger than a fresh load of, say, Twitter? The reality is that for the bulk of users, votes are an uncommon interaction; most of us are here to read the articles and view…

But they're already using javascript, and the issue is the backend response, so this would only be a backend optimization then and doesn't require any fancy frameworks?

No, It’s not needed. I have been using it without javascript for years.

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

#293
post #290

Earlier quoted context omitted.

It's nothing more than an extra header or query param to denote an AJAX request. Then the server can respond with an empty 200/204 status code instead of the entire HTML page. It's an hour of work and would actually save resources. None of this requires a front-end framework.

HN works perfectly with javascript dissabled. It’s a feature

It can still easily work with JavaScript disabled and implement the change.

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

#294
post #129

Earlier quoted context omitted.

I’ve also down voted comments by mistake...

They have added an undown link a while back.

But the undown/unvote links are hard to tap on mobile as well. On firefox on android it's always an exercise in patience.

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

#295
post #260

Earlier quoted context omitted.

So just to clarify, this behavior seems to be by design. In that case it does seem the original comment is objectively wrong if the code is readable and maintainable and accomplishes the desired behavior.

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…

Seconding. Sending back the whole page on AJAX upvote seems unnecessarily wasteful, and sounds like something trivially fixable.

Taking data from 2.5 years ago[0], HN has ~300k daily uniques. Assuming 10% of that are users, each upvoting one story, that's 30k unnecessary page renders per day. That's ~2% of the total views (though the more expensive views - AFAIK when you're logged out, you get cached pages?), so on the one hand it's not much, but on the other hand the fix should be trivial and have minimal impact on code readability.

--

[0] - https://news.ycombinator.com/item?id=9220098

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

#296
post #277

Earlier quoted context omitted.

For anyone curious, http://mbasic.facebook.com/ is one of the least data-intensive way to access facebook.

it also lets you access your messages from a phone

This exactly.

No need for an app or anything.

I’ve been using mbasic on my phone since I read about it here in HN (Thanks HN !), it’s perfect and less intrusive.

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

#297
post #237

Earlier quoted context omitted.

How could it possibly be considered a good thing? I've seen dang say before that they've been running into performance issues, and I bet that they'd see a significant drop in resource usage solely by not generating entire comments pages just to throw them away every time anyone votes on a comment. The response is literally not used at all, they're doing that work and sending that data for no reason. There are multipl…

It's implemented this way for balance of a simple implementation and how lightweight it is. Not to mention, there is at least one benefit: the voting mechanism doesn't depend on JavaScript. And if you are not authenticated, you are instead taken to a login page. Logging in then gives you the redirect and the upvote is registered.

You can return NO_CONTENT on a successful request, and the browser will do nothing.

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

#298
post #237
post #231

Earlier quoted context omitted.

He is wrong. It is not “quite bad”. I appreciate your generosity to him but I am sad to see that is the top comment.

How could it possibly be considered a good thing? I've seen dang say before that they've been running into performance issues, and I bet that they'd see a significant drop in resource usage solely by not generating entire comments pages just to throw them away every time anyone votes on a comment. The response is literally not used at all, they're doing that work and sending that data for no reason. There are multipl…

> How could it possibly be considered a good thing?

It will work with any possible browser under any reasonably foreseeable condition with no maintenance on the part of the HN crew.

> I bet that they'd see a significant drop in resource usage solely by not generating entire comments pages just to throw them away every time anyone votes on a comment.

If there is a serious performance problem they will presumably do some analysis and make changes related to the most serious bottleneck.

> There are multiple downsides

There are multiple irrelevant hypotheticals. If anyone cares about the heavy-weight HN, I hope they don't accidentally click the link to the article and discover the wider internet with images and whatnot.

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

#299
post #208

Earlier quoted context omitted.

That frontend code already exists and does that every time you vote (line 27 of https://news.ycombinator.com/hn.js ). The response content isn't used for anything at all.

If you have JavaScript disabled, the response content is used to hide the upvote sign.

We're talking here about something simple like:

  (if *ajax-request*
     (upvote)
     (upvote-and-generate-page))
Post reply on HN