TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Why No Ajax in HN?

4 点作者 kp25将近 11 年前
I Upvote a post,the vote count will not be updated. I should reload the page everytime to check the top post and also the number of votes. Why Ajax like techniques aren't employed in HN? Any Downsides of using it?

3 条评论

tptacek将近 11 年前
I think one reason might be the &quot;framework level&quot; news.arc code, which does a continuation-passing-like thing for forms to create a sort of synchronous straight-line flow in the code without lots of callbacks. A side effect of that is that some of the code is very tightly coiled around the render-form post-form flow of a standard, 2001-era web application.<p>Another reason is that Graham simply seems a little allergic to Javascript. When you look at HN, think Rails 1 (they come from similar eras). Today, if you had an application like HN, you&#x27;d probably have a serverside that primarily provided a JSON HTTP API for a Javascript project that managed almost all the actual UX. But that wasn&#x27;t at all a normal way to design applications back when HN was first written.
chewxy将近 11 年前
Conversely, ask yourself the opposite question: what will happen if AJAX voting were enabled in HN?<p>- votes will be counted immediately, the number increase. Then what?<p>While this is good UX, would this be helpful in the entire context of HN? What if your vote were a ghost vote - i.e. your user account is a ghosted account? Should it show just for you? If so, you are adding a lot of complexity to the system. Why is such complexity needed?<p>Now, I can&#x27;t speak for dang and kogir, but I think it&#x27;s a rather good thing that the vote counts don&#x27;t increase immediately - prevents gaming
评论 #7963861 未加载
valarauca1将近 11 年前
The honest to god answer is very simple. The website was made, and administered by pg (Paul Graham) directly. He was (until very recently), the only eyes on the code base, and the only maintainer. The code was sloppy, and generally un-reviewed. A lot of features didn&#x27;t exist because they didn&#x27;t exist when the site was started, or were just deemed unnecessary.<p>As of recently a new team has taken over, who before adding new features is porting the entire website over to a more maintainable code standard. New features are coming, just eventually.
评论 #7963707 未加载
评论 #7966139 未加载
评论 #7963690 未加载