6 ms·
Ask HN: Why No Ajax in HN?
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?
- chewxy 12y agoConversely, ask yourself the opposite question: what will happen if AJAX voting were enabled in HN? - votes will be counted immediately, the number increase. Then what? 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? Now, I can't speak for dang and kogir, but I think it's a rather good thing that the vote counts don't increase immediately - prevents gaming
- jaredsohn 12y agoI think it would also be visually distracting and place too much emphasis in how high stories are ranked. Note also that Reddit doesn't work this way.
- valarauca1 12y agoThe 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't exist because they didn't exist when the site was started, or were just deemed unnecessary. 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.
- ajarmst 12y agoIt's fairly impressive that HN lasted this long without creeping featurism and an iteration of "I'll refactor this in my favourite language"(tm) by a new maintainer who (as is normal for humans) confuses "my personal preference" with "objectively better". It couldn't last forever.
- duncan_bayne 12y agoI think you mean rewrite, not refactor. * or perhaps not, but cynicism and beer lead me to a pessimistic outlook as the clock nears midnight
- dang 12y agoThis is a shrewd observation.
- dang 12y ago> The code was sloppy Oh no no. The code is not sloppy. Anyone who has read one of PG's essays or his many HN comments can ask themselves whether his writing seems sloppy. PG's code is like his writing—it is his writing. He does have a distinctive style, and that style (unsurprisingly, to any of his readers) is profoundly minimalist. That's the real answer to the OP's question.
- valarauca1 12y agoIncomprehensible style is a nice word for sloppy. The effect of either is exactly the same, one just implies respect. If you say code that is minimalistic to the point its incomprehensible is better then code so sloppy its incomprehensible, I don't see how one is any better then the other from a maintenance prospective (the former would be better in run time likely).
- tptacek 12y agoOlder versions of the news.arc code have been published. It isn't "incomprehensible"; in fact, it's atypically easy to follow, because it's (perhaps unwisely) built around a continuation passing abstraction he designed for the purpose of simplifying the code. Maybe you'd have an easier time making whatever point you're trying to make about HN's code by pointing to some spot in the news.arc code that you had trouble understanding. There are solid criticisms you can make of HN (I could probably come up with 4 or 5), but the fact that you opened with "sloppy" and "incomprehensible" makes me wonder how closely you actually read the code.
- dang 12y ago"Incomprehensible style is a nice word for sloppy." Then since it isn't sloppy, you won't be surprised to learn that it isn't incomprehensible either. :) In software (as probably in everything) people tend to think that non-standard and uncommon things must be worse. It's in the DNA of Hacker News not to think that way, and to me that is one of its most precious qualities. The HN code is somehow symbolic of all this, whether it's to one's personal taste or not. So yay the HN code!
- wglb 12y agoRegarding that pg was the only eyes on the hn code, this is certainly not the impression I get from reading http://arclanguage.org/ http://arclanguage.org/. There are other users of news.arc, for example http://www.cryptocurrencylive.com/ http://www.cryptocurrencylive.com/. Several HNers have helped maintain the site over the years, sometime in a major way. Looking at the code, it is certainly not sloppy. In fact its size belies its functionality. This is a good thing in programming. I hadn't heard that it is being ported. Is there some reference that you can point to for this? The evidence of new team is that 'dang has stepped up to do more visible and active moderation.
- tptacek 12y agoI think one reason might be the "framework level" 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. 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'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't at all a normal way to design applications back when HN was first written.