Hacker News API is not well designed
Last night, I thought why not develop a HN clone in react and when I looked at API, Oh my goodness. It is not well designed at all, like passing 400 ids, just ids. And to get posts we have to make requests to get single post detail to show 10 or 20 posts on a page. Well, react helped me a bit like storing ids in array and using splice to get next 10 items and so on.
23 comments
[ 4.9 ms ] story [ 58.6 ms ] threadLet's just be honest, bad design is bad design. No slight to PG or anyone working on the site now, and the fact that HN uses flat files rather than a relational database probably limits the API's capabilities in ways that wouldn't be worth the effort of changing. But it's still bad. People just accept it here because they fear anything better might attract the normies.
I disagree. Even if HN had the best API you've ever seen in your life, what difference would it make?
The product here is all about function, not form.
> If Hacker News was submitted to Hacker News it would be ridiculed for many of the reasons it otherwise gets praised for - the archaic layout, poor typography, inconsistent navigation, lack of features, and especially having a badly designed API.
This says more about the audience then it does the product. At a certain point, criticism stops being useful and just becomes a way to flex a superiority muscle. Again, what would making hacker news "prettier" accomplish?
Why do you believe a better designed API would not be about function over form?
Was the bug that caused links to "time out" if you didn't click on them fast enough also a preference for function over form?
Is being able to change the color of the top banner function, not form?
Are the colors chosen for the site function, not form?
Are folding threads or reversible votes or vouching form over function?
No, the product here is as much about form as function. The design of Hacker News is as aesthetic expression. It's meant to be appealing and attractive to a certain demographic, what PG considered a "good hacker."
The site would function better with an updated layout. It would load faster without complex, nested tables, and it would work better on mobile. It would be more readable with better typography, and more usable with features like new comment prompts. People don't want that, not because they wouldn't be a functional improvement, but because they believe such things would violate the site's anti-modernist aesthetic, and people don't want Hacker News to look and feel like a modern forum.
Viewing anything but the status quo as mere cosmetics, as if the site in its current state had somehow already achieved perfection, is a preference for form over function.
1.) If Hacker News had zero users and someone submitted it to Hacker News, the feedback would be brutal.
2.) If Hacker News had its current user base and someone submitted it to Hacker News, they would be praised to such an extent they would likely get inbound requests from people interested in investing.
Traction trumps design, certain designs help create traction, and certain kinds of traction defy design. It's fascinating how it all fits together.
https://news.ycombinator.com/item?id=16720397
There's actually a whole [1] list of opensource Hacker news clones that you can look at to see how they do it...
[1] https://hnpwa.com
My take is that the API forces the N+1 query problem on clients that start with an empty repository.
It wasn't carelessness, btw, but technical constraints we were under at the time. We've slowly been removing those.
http://arclanguage.org/forum