News for hackers. Stuff that matters.
Re:Why is collapsing a Hacker News comment so slow? by ha99ja on Tuesday July 02, 2019 @12:54PM (#20336961)
That is really ugly code.
Re:Why is collapsing a Hacker News comment so slow? by nicolaslem on Tuesday July 02, 2019 @01:04PM (#20337088)
For me HN is a great reminder that done is better than perfect.
Re:Why is collapsing a Hacker News comment so slow? by Deimorz on Tuesday July 02, 2019 @02:19PM (#20337863)
I definitely agree with that. If you look at how HN does any individual thing, it's almost always "wrong", but it really doesn't matter. It's become (and stayed) a thriving community for over 10 years anyway, and almost nobody knows or cares how any of it works.

My favorite example is probably how the "AJAX" voting works: when you vote, the Javascript creates a new <img> tag with the src= attribute set to the vote endpoint, so when the browser tries to load that "image" it does a background request.

It's the kind of dirty hack that hasn't been necessary for an extremely long time and could be replaced with a proper method in minutes, but nobody even notices that's how it works.

Re:Why is collapsing a Hacker News comment so slow? by Toine on Tuesday July 02, 2019 @01:13PM (#20337168)
Solving a real problem with clarity and simplicity of use by knowing your target users is far more important than clean code. However, in the long run, you need good code in order to keep doing this.
Re:Why is collapsing a Hacker News comment so slow? by skohan on Tuesday July 02, 2019 @02:05PM (#20337722)
Clean code is something you should arrive at through iteration rather than a minimum acceptable requirement to put something in production.

In general I would like to achieve the functional goal of the present in the most expedient way possible. If cruft and technical debt from being expedient yesterday is slowing me down, it's time to refactor.

Trying to write perfect code from the start is a fool's enterprise. Often times the full requirements and constraints of a problem will not make themselves known until you're halfway done solving it, or until you're on to the next related problem. Front-loading architecture and software design work often means solving problems you don't really have, or painting yourself into a corner when it turns out the problem is not exactly what you thought it was.

Re:Why is collapsing a Hacker News comment so slow? by krapp on Tuesday July 02, 2019 @04:41PM (#20339237)
Done is only better than perfect because you can't have perfect.

You can still often have better than done, though. The first working implementation is rarely the best possible one.

Re:Why is collapsing a Hacker News comment so slow? by duhi88 on Tuesday July 02, 2019 @02:21PM (#20337886)
Screen reader users might disagree with you.
Re:Why is collapsing a Hacker News comment so slow? by mda on Tuesday July 02, 2019 @01:09PM (#20337134)
More like, "It kinda works, we don't give a crap".
Re:Why is collapsing a Hacker News comment so slow? by dang on Tuesday July 02, 2019 @04:57PM (#20339345)
That's not nice. I don't mind if you diss our code. But I do mind if you say we don't give a crap.
Re:Why is collapsing a Hacker News comment so slow? by thewarpaint on Friday July 05, 2019 @03:55PM (#20365346)
OP here. Dissing was not the intention of my post, if I can help in any way to improve HN let me know, would be more than glad to do so. Peace!
Re:Why is collapsing a Hacker News comment so slow? by jimbob45 on Tuesday July 02, 2019 @01:21PM (#20337259)
The Craigslist special
Re:Why is collapsing a Hacker News comment so slow? by archy_ on Tuesday July 02, 2019 @02:23PM (#20337912)
Yep, and they could easily find volunteers to improve the site (make the login page look nicer, maybe even implement 2fa) but there's no incentive to improve
Re:Why is collapsing a Hacker News comment so slow? by rolltiide on Tuesday July 02, 2019 @01:13PM (#20337172)
as it should be

think about all the other things perfectionist coders and product managers could be working on