News for hackers. Stuff that matters.
Re:Tell HN: Thank you for not redesigning Hacker News by Deimorz on Sunday September 01, 2019 @04:25PM (#20854662)
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 finish.

Re:Tell HN: Thank you for not redesigning Hacker News by FreeHugs on Sunday September 01, 2019 @05:02PM (#20854869)

    This means that every vote results in a
    response that's usually around 10KB gzipped
I have Facebook open in another window and opened the network inspector to compare it:

Just moving the mouse towards the like button created 824KB of data transfer. Not sure if it is because of tracking the mouse movement or if it preloads stuff it thinks my mouse is moving towards. Or maybe it loads stuff that it would display if I held the mouse over something longer. No idea. But it loaded 824KB without me interacting with anything. Just because I moved the mouse.

The actual click on the like button added 30KB on top of that.

Re:Tell HN: Thank you for not redesigning Hacker News by Deimorz on Sunday September 01, 2019 @06:42PM (#20855491)
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 worth of responses to voting every day that are all just thrown away.

Re:Tell HN: Thank you for not redesigning Hacker News by noobermin on Sunday September 01, 2019 @09:03PM (#20856003)
>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.

Re:Tell HN: Thank you for not redesigning Hacker News by drusepth on Monday September 02, 2019 @12:12AM (#20856724)
Comparing to Facebook is probably the worst possible comparison, though, and doesn't seem representative of most other sites.
Re:Tell HN: Thank you for not redesigning Hacker News by GoblinSlayer on Monday September 02, 2019 @05:01AM (#20857751)
Only a very few sites are not bloated Facebook clone abominations.
Re:Tell HN: Thank you for not redesigning Hacker News by netfl0 on Sunday September 01, 2019 @10:39PM (#20856393)
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.

Re:Tell HN: Thank you for not redesigning Hacker News by Deimorz on Sunday September 01, 2019 @10:59PM (#20856476)
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 multiple downsides and not a single benefit to the current method.

Re:Tell HN: Thank you for not redesigning Hacker News by samtheprogram on Sunday September 01, 2019 @11:55PM (#20856668)
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.

Re:Tell HN: Thank you for not redesigning Hacker News by 171243 on Monday September 02, 2019 @12:28AM (#20856775)
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.
Re:Tell HN: Thank you for not redesigning Hacker News by csande17 on Monday September 02, 2019 @01:26AM (#20856947)
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 need one if-statement on the server side to send a blank response instead of a redirect.

Sure, 10 KB of download and the server CPU time needed to re-generate the listing page is probably pretty negligible, but multiply that by the number of votes casted on Hacker News every day and it starts to add up.

Re:Tell HN: Thank you for not redesigning Hacker News by Deimorz on Monday September 02, 2019 @01:45AM (#20857013)
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 relatively low number of comments (~10% of the thread) than they did when loading the entire page originally. It also has to re-generate the page an extra 30 times unnecessarily - a repeatedly voting user becomes like a heavy multiplier to your traffic.

[1]: Also, I just noticed that the responses back from voting actually aren't the full page, they're truncated. It seems like maybe the response size is capped at 16KB gzipped? That implies that there's already some kind of special handling for the voting responses.

Re:Tell HN: Thank you for not redesigning Hacker News by southerntofu on Monday September 02, 2019 @05:31AM (#20857876)
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 by TeMPOraL on Monday September 02, 2019 @03:13AM (#20857300)
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 by zzo38computer on Monday September 02, 2019 @04:58PM (#20861725)
It is possible to do both. Such as, have the link like it is now, but add a JavaScript code which replaces the link with one that executes the JavaScript code to make a request that returns nothing (if you are logged in). If JavaScript is disabled or unimplemented, it will still work.
Re:Tell HN: Thank you for not redesigning Hacker News by jbverschoor on Monday September 02, 2019 @03:21AM (#20857331)
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 by roenxi on Monday September 02, 2019 @03:22AM (#20857334)
> 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 by neop1x on Monday September 02, 2019 @05:38AM (#20857903)
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 by acangiano on Sunday September 01, 2019 @08:01PM (#20855781)
I have a gigabit Internet connection with top of the line laptops and Facebook still makes me wait for a second or two simply to show me 5 notifications.
Re:Tell HN: Thank you for not redesigning Hacker News by colejohnson66 on Monday September 02, 2019 @04:52PM (#20861678)
You may have gigabit, but what’s your ping time?
Re:Tell HN: Thank you for not redesigning Hacker News by acangiano on Tuesday September 03, 2019 @03:22AM (#20864308)
To Facebook.com, about 25 ms.
Re:Tell HN: Thank you for not redesigning Hacker News by p3st1l3nt on Sunday September 01, 2019 @06:14PM (#20855355)
They might be tracking your browsing habits. For instance if you hover over the like button and rest the cursor there for a moment but you subsequently don't like the post, it could mean that you thought of liking that post but you did not do it for whatever reason. Or they are just prefetching pages.
Re:Tell HN: Thank you for not redesigning Hacker News by quickthrower2 on Monday September 02, 2019 @09:10PM (#20862933)
This is a diversion to the point being made.

Facebook is a very different site, and could be lazy loading anything, and do you know the mouse move was causal? was there a window.setTimeout initiating it?. Facebook is not a site i'd expect to use on a low bandwidth connection, or if I did I'd use a low bandwidth version if possible (like Gmail has a HTML only version).

Re:Tell HN: Thank you for not redesigning Hacker News by manojlds on Sunday September 01, 2019 @11:21PM (#20856536)
In lower internet speeds Facebook loads a lite version which is super fast (loads better than HN for me) and has most of the basic functionalities.
Re:Tell HN: Thank you for not redesigning Hacker News by throwawaypls on Sunday September 01, 2019 @11:31PM (#20856578)
For anyone curious, http://mbasic.facebook.com/ is one of the least data-intensive way to access facebook.
Re:Tell HN: Thank you for not redesigning Hacker News by zem on Monday September 02, 2019 @01:49AM (#20857027)
it also lets you access your messages from a phone
Re:Tell HN: Thank you for not redesigning Hacker News by JeanMarcS on Monday September 02, 2019 @03:20AM (#20857329)
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 by JaRail on Monday September 02, 2019 @01:03AM (#20856865)
The actual like is pretty small, about half a KB. Just a light graphql query that responds with updated counts for different reactions (happy/sad/etc). They definitely batch it with some other stuff though. Batching is really important for browser performance.
Re:Tell HN: Thank you for not redesigning Hacker News by Hmaal on Monday September 02, 2019 @01:05PM (#20860403)
Does this explain why my votes on mobile often don't go through on the first click?
Re:Tell HN: Thank you for not redesigning Hacker News by phjesusthatguy3 on Sunday September 01, 2019 @09:47PM (#20856200)
You don't have to use the actual words "what about" in your whataboutism post.
Re:Tell HN: Thank you for not redesigning Hacker News by phjesusthatguy3 on Sunday September 01, 2019 @09:54PM (#20856228)
Let's put it this way: if HN cleaned up their act, the next time "whatabout facebook?" came up, there would be a larger delta to whatabout.
Re:Tell HN: Thank you for not redesigning Hacker News by Eric_WVGG on Sunday September 01, 2019 @04:38PM (#20854744)
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.

Re:Tell HN: Thank you for not redesigning Hacker News by lostgame on Sunday September 01, 2019 @06:48PM (#20855522)
Hehe, I had never thought of this, but you're right. It's not just an iPad, either - it's the same on my Microsoft surface.

I got so used to pinch-to-zooming, for so many years, I guess I didn't even consider that usability flaw.

Re:Tell HN: Thank you for not redesigning Hacker News by digitalengineer on Monday September 02, 2019 @03:53AM (#20857458)
This. Please spend a little more time on the css. And a somewhat bigger up/downvote arrow would be great. I don’t have fat fingers but still accidentally click the wrong one every now and then.
Re:Tell HN: Thank you for not redesigning Hacker News by spraak on Sunday September 01, 2019 @08:35PM (#20855898)
I always need to zoom to vote or collapse threads on mobile
Re:Tell HN: Thank you for not redesigning Hacker News by rapnie on Monday September 02, 2019 @03:51AM (#20857453)
Yes, me too. I suggested adding more spacing between upvote / downvote links for usability on mobile.
Re:Tell HN: Thank you for not redesigning Hacker News by Vinnl on Monday September 02, 2019 @03:48AM (#20857442)
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.)

Re:Tell HN: Thank you for not redesigning Hacker News by a_f on Monday September 02, 2019 @05:35AM (#20857889)
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 by Vinnl on Monday September 02, 2019 @06:50AM (#20858208)
Good to hear :) I've not spent too much effort on it (nor am I planning to), but feel free to report an Issue if you have suggestions for small improvements.
Re:Tell HN: Thank you for not redesigning Hacker News by r00fus on Sunday September 01, 2019 @09:09PM (#20856028)
On mobile, I use MiniHack (there are tons of other HN apps). On desktop, HN's interface works well enough that I don't try to mess with it.

I really wish I could do one feature on the desktop/web that mobile MiniHack.app does on mobile - to enforce all links opened launch in reader mode in Safari webview. 99% of the time that's exactly what I want when I click through.

Re:Tell HN: Thank you for not redesigning Hacker News by perilunar on Monday September 02, 2019 @03:53AM (#20857460)
I just use a bookmarklet to increase the font size. It requires an extra tap, but I'd rather do that than use an app.

The bookmarklet:

  javascript:(function()%7Bvar%20n=window.document.createElement(%22style%22);n.setAttribute(%22type%22,%22text/css%22);n.innerText=%22html%7Bfont-size:1.2em!important;line-height:1.3!important;%7Dbody,table,tr,td,.default,.comment,.comhead,.pagetop,span.pagetop%20b,.c00,.yclinks%7Bfont-size:inherit!important;line-height:inherit!important;%7D.pagetop,.title%7Bfont-size:1.2em!important;%7Dtable%23hnmain%7Bwidth:100%25!important;%7Dbody%7Bmargin:0;%7D%22;window.document.head.appendChild(n)%7D)()
Re:Tell HN: Thank you for not redesigning Hacker News by baby on Monday September 02, 2019 @12:27AM (#20856769)
Paying to browse a free website? Check premii
Re:Tell HN: Thank you for not redesigning Hacker News by r00fus on Tuesday September 03, 2019 @12:31AM (#20863697)
My time isn't free. I don't mind paying a small up-front fee for usability. Plus, upvotes with HN's site ui on mobile resulted in mis-votes - that's fixed with MiniHack or other HN apps.
Re:Tell HN: Thank you for not redesigning Hacker News by SiebenHeaven on Monday September 02, 2019 @12:39AM (#20856803)
Seems significantly slower to me on my 3G network compared to hn
Re:Tell HN: Thank you for not redesigning Hacker News by graeme on Sunday September 01, 2019 @04:56PM (#20854831)
What do you mean? Haven't had that issue. Am on desktop version, unsure if mobile exists
Re:Tell HN: Thank you for not redesigning Hacker News by zoul on Sunday September 01, 2019 @04:58PM (#20854846)
The tap targets are minuscule and close to each other.
Re:Tell HN: Thank you for not redesigning Hacker News by tobinfricke on Sunday September 01, 2019 @05:20PM (#20854991)
I had to pinch-to-zoom to upvote this comment. :-)
Re:Tell HN: Thank you for not redesigning Hacker News by zaroth on Sunday September 01, 2019 @05:26PM (#20855027)
That's a feature IMO -- HN could even make them even smaller.

It should take conscious effort to vote, and the small target size mentally reinforces this model; that it's not supposed to be the most common action.

EDIT: See, clearly the vote targets simply aren't small enough! </s>

Re:Tell HN: Thank you for not redesigning Hacker News by danek on Sunday September 01, 2019 @11:39PM (#20856618)
I rarely wish to click on the username or time links (“3 hours ago”), but that’s what I click on the most due to size and placement issues (when trying to vote or collapse a thread). I agree one should not blindly vote, but at the same time if you have decided to vote, it shouldn’t be maddeningly difficult and error prone to execute.
Re:Tell HN: Thank you for not redesigning Hacker News by watt on Monday September 02, 2019 @04:28AM (#20857593)
Usability-wise, isn't it kind of weird that the click target you use the most (upvote arrow) is the smallest of the three? And the ones that you use rarely or never, are so easy to hit by accident. Why must world be like this?
Re:Tell HN: Thank you for not redesigning Hacker News by scarface74 on Sunday September 01, 2019 @05:40PM (#20855135)
I’ve also down voted comments by mistake...
Re:Tell HN: Thank you for not redesigning Hacker News by zaroth on Sunday September 01, 2019 @05:52PM (#20855216)
They have added an undown link a while back.
Re:Tell HN: Thank you for not redesigning Hacker News by slavik81 on Monday September 02, 2019 @04:42AM (#20857653)
Adding undo changed the feel of downvotes a little. Irreversible accidental downvotes were scattered randomly on comments and they made the occasional downvote feel less harsh.
Re:Tell HN: Thank you for not redesigning Hacker News by yoz-y on Monday September 02, 2019 @03:13AM (#20857298)
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 by robocat on Sunday September 01, 2019 @05:25PM (#20855018)
Related question: what is the easiest way to increase the tap zone of a HTML element using CSS?

Aside: I have noticed Safari auto-inceases the touch zone for inputs and elements with ontouch/onclick events (I noticed because I had to fix an issue caused by this!)

Re:Tell HN: Thank you for not redesigning Hacker News by deftturtle on Sunday September 01, 2019 @05:32PM (#20855071)
a {padding: 1rem}

This increases area by padding the link. Just don’t want the rap areas of different elements to overlap with too much padding.

You can also put a border around the new area, or a box shadow, to indicate larger click area, making it a button sort of:

{border: thin solid grey}

Re:Tell HN: Thank you for not redesigning Hacker News by eurasiantiger on Sunday September 01, 2019 @06:08PM (#20855314)
Note that the <a> element is inline by default, which means top and bottom padding is not applied. Set display: inline-block; to have padding apply all around while retaining the element’s flow in the layout.
Re:Tell HN: Thank you for not redesigning Hacker News by deftturtle on Monday September 02, 2019 @07:57PM (#20862614)
Thank you! I’m still learning CSS and will have to adjust my style sheets! :)
Re:Tell HN: Thank you for not redesigning Hacker News by tryptophan on Sunday September 01, 2019 @05:35PM (#20855099)
Probably just add some extra "padding: 5px". All the padding area registers "clicks" for the element.
Re:Tell HN: Thank you for not redesigning Hacker News by fanick on Monday September 02, 2019 @02:13AM (#20857108)
For the thread collapsing functionality I think the long press/touch could mitigate the need for pinch zooming. Just hold your thumb on the comment long enough and bang, it's gone. For me this is the most commonly performed interaction with the site.
Re:Tell HN: Thank you for not redesigning Hacker News by jquery on Monday September 02, 2019 @02:30AM (#20857156)
I find this behavior on Reddit annoying when I’m reading a long comment and the thread suddenly collapses because I left my finger on the screen. There’s pros and cons to the approach.
Re:Tell HN: Thank you for not redesigning Hacker News by JaRail on Monday September 02, 2019 @01:10AM (#20856892)
The trick is to keep your karma below 500. xD
Re:Tell HN: Thank you for not redesigning Hacker News by Beldin on Monday September 02, 2019 @01:29AM (#20856965)
Thanks! As someone who lurks here much, much more than commenting, I wasn't aware that the interface would change over 500 karma.

This does put the discussion in a different light (not to mention helps avoids me making comments that don't apply to more karmarific users).

Re:Tell HN: Thank you for not redesigning Hacker News by thrower123 on Sunday September 01, 2019 @05:31PM (#20855068)
That's weird - must be an iPad specific thing. It works just fine on Android Chrome.
Re:Tell HN: Thank you for not redesigning Hacker News by nkrisc on Tuesday September 03, 2019 @03:10PM (#20870025)
I've noticed that an Android Chrome I have no issues hitting the links on this site, but if I switch over to Firefox I can barely click anything. It's not just this site. That annoyance alone has almost driven me back to Chrome.
Re:Tell HN: Thank you for not redesigning Hacker News by sequoia on Sunday September 01, 2019 @10:21PM (#20856325)
I always accidentally log out when I try to click on my username in iOS.
Re:Tell HN: Thank you for not redesigning Hacker News by graeme on Monday September 02, 2019 @09:43AM (#20859061)
Oh true, that happens to me a lot.
Re:Tell HN: Thank you for not redesigning Hacker News by ebg13 on Sunday September 01, 2019 @06:09PM (#20855320)
All elements are super tiny unless you force zoom on them. The CSS says that all fonts are 10pt or _smaller_. There are 7pt fonts defined in there! Everything else is specified in exact pixels. Vote arrows are 10x10 pixels. Do you realize how small 10x10 pixels is on a modern display?
Re:Tell HN: Thank you for not redesigning Hacker News by reificator on Sunday September 01, 2019 @07:45PM (#20855714)
> Do you realize how small 10x10 pixels is on a modern display?

CSS `px` units are not equivalent to a device pixel.

https://www.w3.org/TR/css3-values/#absolute-lengths

Re:Tell HN: Thank you for not redesigning Hacker News by ebg13 on Sunday September 01, 2019 @11:25PM (#20856551)
That doesn't make it better. 10px at 1/96 inch per px makes them only 2.6mm.
Re:Tell HN: Thank you for not redesigning Hacker News by zeta0134 on Sunday September 01, 2019 @06:24PM (#20855414)
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 the comments. The additional complexity needed to make votes small has an upfront cost, and in this case, I feel the simplicity of the base interface is the better thing to optimize for, and HN's designers appear to agree. 10 kB for what is effectively a server-side page reload (which probably gracefully degrades for folks running NoScript) seems fine.

Re:Tell HN: Thank you for not redesigning Hacker News by manigandham on Sunday September 01, 2019 @08:31PM (#20855883)
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.
Re:Tell HN: Thank you for not redesigning Hacker News by iforgotpassword on Monday September 02, 2019 @03:46AM (#20857434)
No need for custom header or query param, Ajax (xmlhttp) requests already have an extra header field set automatically, so all is needed is some if statement server side, assuming registering the upvote and rendering the page is not entangled in some super crazy way.
Re:Tell HN: Thank you for not redesigning Hacker News by pmarin on Monday September 02, 2019 @02:56AM (#20857241)
HN works perfectly with javascript dissabled. It’s a feature
Re:Tell HN: Thank you for not redesigning Hacker News by IanCal on Monday September 02, 2019 @03:05AM (#20857275)
It can still easily work with JavaScript disabled and implement the change.
Re:Tell HN: Thank you for not redesigning Hacker News by manigandham on Monday September 02, 2019 @05:08AM (#20857781)
We're talking about it working better when JS is enabled.
Re:Tell HN: Thank you for not redesigning Hacker News by xur17 on Sunday September 01, 2019 @08:43PM (#20855931)
You'd need some frontend code to hide the upvote icon though.
Re:Tell HN: Thank you for not redesigning Hacker News by Deimorz on Sunday September 01, 2019 @09:14PM (#20856056)
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.
Re:Tell HN: Thank you for not redesigning Hacker News by zeta0134 on Sunday September 01, 2019 @10:32PM (#20856368)
Nice! I hadn't actually looked at the code before writing my comment. That does seem relatively trivial, so I stand corrected. I didn't realize the clientside code was discarding the response; I sorta naively assumed it was doing a DOM replacement or something equally straightforward.

What a pleasantly tiny script file. More site code should be this easy to read.

Re:Tell HN: Thank you for not redesigning Hacker News by samtheprogram on Sunday September 01, 2019 @11:59PM (#20856681)
If you have JavaScript disabled, the response content is used to hide the upvote sign.
Re:Tell HN: Thank you for not redesigning Hacker News by TeMPOraL on Monday September 02, 2019 @03:22AM (#20857337)
We're talking here about something simple like:

  (if *ajax-request*
     (upvote)
     (upvote-and-generate-page))
Re:Tell HN: Thank you for not redesigning Hacker News by novok on Sunday September 01, 2019 @06:33PM (#20855459)
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?
Re:Tell HN: Thank you for not redesigning Hacker News by pmarin on Monday September 02, 2019 @02:57AM (#20857245)
No, It’s not needed. I have been using it without javascript for years.
Re:Tell HN: Thank you for not redesigning Hacker News by nindalf on Monday September 02, 2019 @03:31AM (#20857369)
You aren’t understanding the person you’re replying to.

No one is contesting that HN can work without JS. But for those who have JS enabled, it uses JS. For these people the optimisation could be implemented.

Re:Tell HN: Thank you for not redesigning Hacker News by raverbashing on Sunday September 01, 2019 @05:46PM (#20855171)
I'm going to agree and say there are minor usability/functionality quirks like these

For example, adding a story to favourites shouldn't redirect it back to the main page

At the same time there were a couple of minor improvements "recently", like the undo feature for votes which were a bit of high-impact low hanging fruit.

Apart from that I'm just happy I can customize the level of orangeness on the top bar to a lighter shade

Re:Tell HN: Thank you for not redesigning Hacker News by pizza234 on Sunday September 01, 2019 @06:05PM (#20855297)
Also, worth mentioning the insufficient formatting features. Quoting is not supported, and is quite important for forum discussions' UX.
Re:Tell HN: Thank you for not redesigning Hacker News by Jaruzel on Monday September 02, 2019 @02:37AM (#20857179)
For me, the only formatting issue is the code blocks that people use for quoting from linked articles - it doesn't wrap properly on mobile.

Other than that I like the minimalism. I even think the lack of automatically quoting the parent comment is a good thing, as it forces the user to think about the part of the parent they want to quote instead of wholesale quoting it all as the lazy option. If auto-quoting existed the comments would be 40% quotes of each other, and much harder to read.

Re:Tell HN: Thank you for not redesigning Hacker News by tripzilch on Monday September 02, 2019 @12:56PM (#20860333)
The code blocks sometimes also cause horizontal scrollbars on desktop. And all they have to do is add one CSS rule (white-space:pre-wrap).

But apparently there's people who dislike wrapping code so much, that it's worth messing up the layout of a whole discussion even if only one comment has code in it (or by accident, even). Personally, I dislike horizontal scrolling much stronger (and I actually mildly prefer wrapping code, but that's taste, the horizontal scrolling is a big annoyance).

Re:Tell HN: Thank you for not redesigning Hacker News by ian0 on Sunday September 01, 2019 @07:48PM (#20855727)
>> Also, worth mentioning the insufficient formatting features. Quoting is not supported, and is quite important for forum discussions' UX

Exactly

Re:Tell HN: Thank you for not redesigning Hacker News by pizza234 on Monday September 02, 2019 @04:16AM (#20857537)
I'm not sure if this is sarcastic or not, but the problem is when the quoted text is longer and/or multiline, and especially when it's both.

You typically see users working this around with spacing, and (sometimes) other users complaining (rightfully) that they can't see the full text on mobile without scrolling.

This is exacerbated by the fact that then HN rendering only has the "<p>" concept, not the "<br>". If one works this around using the greater than symbol, and there are several entries, it blends too much with user-typed text.

It's not a very big deal, but it's pretty much standard feature in forum engines, and the lack of it makes the text outlook unnecessarily worse.

Re:Tell HN: Thank you for not redesigning Hacker News by grawprog on Sunday September 01, 2019 @09:25PM (#20856102)
>Exactly

But it doesn't turn green.

Re:Tell HN: Thank you for not redesigning Hacker News by ezequiel-garzon on Sunday September 01, 2019 @04:52PM (#20854809)
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?
Re:Tell HN: Thank you for not redesigning Hacker News by manigandham on Sunday September 01, 2019 @08:32PM (#20855887)
You're correct that when JS is disabled, any interaction requires a HTTP request from a link or form, and that does a full page reload.

However when JS and AJAX is used, it's expected that it also avoids an entire full-page HTML response that goes unused. It can easily be a 204 instead.

Re:Tell HN: Thank you for not redesigning Hacker News by jakeogh on Monday September 02, 2019 @05:14AM (#20857805)
Can't frame tags reload independently?
Re:Tell HN: Thank you for not redesigning Hacker News by manigandham on Monday September 02, 2019 @04:00PM (#20861430)
It's still a full page refresh but with a page within a page. Making every comment a separate iframe would make the site very resource intensive on client and server.
Re:Tell HN: Thank you for not redesigning Hacker News by jakeogh on Monday September 02, 2019 @06:07PM (#20862084)
I dont see why it would be resource intensive server side. In fact, it would be less resource intensive, since we avoid a full page reload and instead reload a single comment iframe.

As for the rendering engine, a iframe tag per comment is nothing compared to the pile of JS that's normally there on other sites.

Re:Tell HN: Thank you for not redesigning Hacker News by manigandham on Monday September 02, 2019 @06:35PM (#20862209)
Every frame is still a full HTML document that needs to be generated even if it just contains a single comment. This page has 370+ comments which would mean 370+ additional HTTP requests to load them all as standalone HTML pages. That's a massive increase in server load.

On the client, iframe tags are entirely separate browser windows and can use up considerable resources. It's like opening up hundreds of tabs and is far more intensive than running some javascript code which is quickly parsed, compiled and cached in modern JS engines.

Re:Tell HN: Thank you for not redesigning Hacker News by jakeogh on Monday September 02, 2019 @07:02PM (#20862349)
Ah. Thanks. Understood. I often wonder if one could whitelist a very small subset of JS and avoid Turing Completeness but enable 90% of the use cases.
Re:Tell HN: Thank you for not redesigning Hacker News by nothrabannosir on Sunday September 01, 2019 @08:04PM (#20855796)
No this is about JS enabled. It's the same endpoint. Open dev console and have a look.
Re:Tell HN: Thank you for not redesigning Hacker News by segfaultbuserr on Monday September 02, 2019 @05:35AM (#20857890)
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 by Deimorz on Sunday September 01, 2019 @04:57PM (#20854839)
No, voting doesn't work at all with JS disabled.
Re:Tell HN: Thank you for not redesigning Hacker News by icebraining on Sunday September 01, 2019 @05:18PM (#20854980)
Yes, it does. I think you have something weird with your browser: with JS on, it does a light AJAX request, without it, it does the whole redirect thing.
Re:Tell HN: Thank you for not redesigning Hacker News by manigandham on Sunday September 01, 2019 @06:10PM (#20855322)
The request is the same. The buttons are <a> tags. Without JS, the link is clicked and does a full page reload. With JS, the click is caught and sent as a AJAX request where the response is ignored.

It's not any lighter, it's just not reloading the page.

Re:Tell HN: Thank you for not redesigning Hacker News by oplav on Sunday September 01, 2019 @05:37PM (#20855113)
https://i.imgur.com/9z2VAfa.png

These are my network requests when I vote with JS enabled.

Re:Tell HN: Thank you for not redesigning Hacker News by Deimorz on Sunday September 01, 2019 @06:39PM (#20855481)
Whoops, you're right, it does work either way. The response is the same with or without JS though, it just doesn't do anything with it when JS is enabled (because as a hacky way of doing "AJAX" it sets the voting url as the src value of an <img> tag that doesn't actually get displayed).
Re:Tell HN: Thank you for not redesigning Hacker News by cynwoody on Sunday September 01, 2019 @11:39PM (#20856617)
Voting does work with JS disabled, just not well.

The page reloads and re-renders with the UI changes (up-down buttons hidden and unvote link added). However, the reload takes noticeable time, and you lose your scroll location, which is disorienting.

With JS enabled, the UI changes happen instantly, and the scroll position doesn't change. The page still reloads, but the reload is directed into a new Image object which is immediately garbage, so it's off the UI timeline. But it's inexplicable bandwidth waste, nonetheless!

Re:Tell HN: Thank you for not redesigning Hacker News by crispyporkbites on Sunday September 01, 2019 @05:05PM (#20854892)
You can do this without javascript, you just create a form that sends an XHR PUT/POST request and returns back a 200 response.

You can't do much with the response without JS but a single upvote doesn't change anything on the page so there's no need for the reload.

Re:Tell HN: Thank you for not redesigning Hacker News by icebraining on Sunday September 01, 2019 @05:20PM (#20854990)
> a single upvote doesn't change anything on the page

Not much, but it does hide the arrows and shows an undo link on the comment.

Re:Tell HN: Thank you for not redesigning Hacker News by pmarin on Monday September 02, 2019 @02:53AM (#20857231)
This is probably the reason upvotes still work with javascript dissabled. It’s a feature.
Re:Tell HN: Thank you for not redesigning Hacker News by iforgotpassword on Monday September 02, 2019 @03:36AM (#20857395)
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.
Re:Tell HN: Thank you for not redesigning Hacker News by oefrha on Monday September 02, 2019 @04:16AM (#20857536)
> 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.

Re:Tell HN: Thank you for not redesigning Hacker News by iforgotpassword on Monday September 02, 2019 @06:05AM (#20858002)
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.
Re:Tell HN: Thank you for not redesigning Hacker News by netfl0 on Sunday September 01, 2019 @10:36PM (#20856381)
Seriously, this is not an issue.
Re:Tell HN: Thank you for not redesigning Hacker News by oneepic on Sunday September 01, 2019 @11:36PM (#20856603)
+1, thank you.
Re:Tell HN: Thank you for not redesigning Hacker News by NicoJuicy on Sunday September 01, 2019 @07:45PM (#20855715)
Reloading the page is way easier then rebuilding the entire comment section, should something be renewed ( eg. a new comment).

It also (partially) removes the requirement for live-pages on an active post here.

Re:Tell HN: Thank you for not redesigning Hacker News by nothrabannosir on Sunday September 01, 2019 @08:03PM (#20855790)
This isn't about reloading the page on voting with JS disabled; it's about the XHR call when you have JS enabled. It goes to the same endpoint as a non-JS call, ultimately loading the new page, but completely discards it (as it is an XHR call not an actual pageload).
Re:Tell HN: Thank you for not redesigning Hacker News by harel on Monday September 02, 2019 @05:33AM (#20857881)
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 by krapp on Monday September 02, 2019 @05:48AM (#20857935)
>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 by harel on Monday September 02, 2019 @07:20AM (#20858375)
Very possible. Also possible there was a valid reason at the time, and even though it's no longer valid nobody bothered to look into it. All I'm saying is that "created" things exist/happen for a reason, which is not always obvious to a 3rd party. I've had this happen with my own code. I find some old code that looks really dumb, no idea why I wrote it like that. I then spend time to refactor it properly, only to hit some obscure edge case which ultimately leads me back to the 'dumb code'
[dead]
Re:Tell HN: Thank you for not redesigning Hacker News by 18pfsmt on Sunday September 01, 2019 @05:46PM (#20855170)
> It should use 5-50 megabytes of data per page load.

Mandatory min of 5MB vs. current 10KB?

I'm pretty sure I'm missing the logic here. I sometimes rely on a satellite connection in my access, and I don't hold HN responsible for that fact.

I do agree that no anger is merited (nor sane).

Re:Tell HN: Thank you for not redesigning Hacker News by mikewhy on Sunday September 01, 2019 @05:49PM (#20855195)
The person you're replying to is most likely making a low-effort troll post on how large webapps tend to be now. Keep in mind that most of what's downloaded would be cached, and the response from an up / down vote would be considerably smaller than 10KB.
Re:Tell HN: Thank you for not redesigning Hacker News by snovv_crash on Sunday September 01, 2019 @06:35PM (#20855470)
> 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.

Re:Tell HN: Thank you for not redesigning Hacker News by madamelic on Sunday September 01, 2019 @07:58PM (#20855765)
Something tells me that YC isn't about acquiring users to have a unicorn exit of HackerNews.
Re:Tell HN: Thank you for not redesigning Hacker News by GoblinSlayer on Monday September 02, 2019 @05:36AM (#20857895)
Shitting on users is bad no matter what site you make.
Re:Tell HN: Thank you for not redesigning Hacker News by thrwwyw3489 on Sunday September 01, 2019 @07:32PM (#20855659)
you call it low-effort but in fact the person doesn't see it as obvious satire.

It really does seem this is exactly how modern web app redesigns are done.

Re:Tell HN: Thank you for not redesigning Hacker News by lukas099 on Sunday September 01, 2019 @06:06PM (#20855301)
Sarcasm
Re:Tell HN: Thank you for not redesigning Hacker News by 18pfsmt on Sunday September 01, 2019 @10:06PM (#20856273)
Not only are we supposed to assume good faith comments on HN, reddit-type snark is looked down upon for a reason.

Per HN guidelines, 'don't talk shit you wouldn't say in person.' There is so much ridiculous rhetoric on HN these days, satire is difficult to discern.

Edit: Re-reading the original comment in its entirety, rather than focusing on numbers, I guess it's obvious satire. I naively assumed that's not the convention on HN.

Re:Tell HN: Thank you for not redesigning Hacker News by DC-3 on Sunday September 01, 2019 @05:43PM (#20855147)
Since he's probably too modest to mention it himself, the user you're replying to is the founder of the news aggregator and forum site Tildes [1] which is pretty much the gold standard of modern forum site design imho. If anyone has the right to make this comment it's him.

[1] https://tildes.net

Re:Tell HN: Thank you for not redesigning Hacker News by 18pfsmt on Sunday September 01, 2019 @05:57PM (#20855255)
>which is pretty much the gold standard of modern forum site design

Wait, what?

>open-source link aggregator with no ads or tracking (currently in invite-only alpha)

HN is over 12 years old and much larger. Suggesting an alpha-level service is the "gold standard" is pure hyperbole.

I'm not familiar with the founder, so I am not making any judgement; and, I support the basic premise of their project.

Re:Tell HN: Thank you for not redesigning Hacker News by Deimorz on Sunday September 01, 2019 @08:14PM (#20855823)
I think they were just talking about the design. HN is certainly a lot more active and successful overall, but it's extremely minimal for both design and functionality (which is part of its appeal).

Tildes's design has a lot more to it, including better responsiveness for mobile use, a built-in theme system with multiple themes (including dark ones), full markdown (CommonMark/"GitHub Flavored Markdown") support, syntax highlighting for code, etc. There are lots of aspects of it that would be nice to have on HN.

Re:Tell HN: Thank you for not redesigning Hacker News by Deimorz on Sunday September 01, 2019 @07:05PM (#20855583)
Thanks! I'm honestly a pretty terrible designer overall and there's still a lot that's bad about Tildes's design, but it's slowly improving. There are some major changes coming soon, and hopefully those will help some more too.
Re:Tell HN: Thank you for not redesigning Hacker News by thrwwyw3489 on Sunday September 01, 2019 @07:34PM (#20855664)
It looks pretty good. I would add a bit of left margin (can be responsive, it looks good currently in a narrow/mobile window) but the rest is gold.
Re:Tell HN: Thank you for not redesigning Hacker News by streb-lo on Sunday September 01, 2019 @07:46PM (#20855718)
Any chance of an invite?
Re:Tell HN: Thank you for not redesigning Hacker News by Deimorz on Sunday September 01, 2019 @07:57PM (#20855757)
Definitely (open for anyone else too) - there's no messaging on HN though, so just send me an email to the address in the announcement post: https://blog.tildes.net/announcing-tildes
Re:Tell HN: Thank you for not redesigning Hacker News by iambateman on Sunday September 01, 2019 @05:30PM (#20855057)
Truly awful.