Amir Salihefendic

amix.dk · Personal blog · on HN since 2007

Amir Salihefendic writes about programming, web infrastructure, and productivity, including how Hacker News and Reddit rank posts.

What HN saysHN links it mainly for its explanations of the Hacker News and Reddit ranking algorithms, which commenters call detailed and useful.
87HN people shared it
45linked it in comments
79stories submitted
1.5Kstory points
11 years agolast shared
2007people per year2026

Most-shared posts

  1. 1
    How Hacker News ranking algorithm works
    23 people · 313 points · first shared 2010 · 74 comments on HN
  2. 2
    How Reddit ranking algorithms work
    23 people · 274 points · first shared 2010 · 29 comments on HN
  3. 3
    Is node.js best for Comet?
    5 people · 27 points · first shared 2010 · 26 comments on HN
  4. 4
    Model View Controller: History, theory and usage
    4 people · 78 points · first shared 2011 · 8 comments on HN
  5. 5
    Node.js powers comet for plurk (100k+ users at once)
    3 people · 87 points · first shared 2010 · 26 comments on HN
  6. 6
  7. 7
    Zen room for Vim: Focsuing only on the essential
    2 people · 55 points · first shared 2013 · 26 comments on HN
  8. 8
    Plurk Comet: Handling of 100.000+ open connections
    2 people · 44 points · first shared 2009 · 38 comments on HN
  9. 9
    The main issue with non-blocking servers
    2 people · 3 points · first shared 2010 · discussion on HN
  10. 10
  11. 11
    Redis_wrap: Python wrapper for Redis datatypes
    2 people · 2 points · first shared 2010 · discussion on HN
  12. 12
    CloudFlare review: The Real Thing or Marketing Bullshit?
    2 people · 2 points · first shared 2011 · 1 comments on HN
  13. 13
    Finding and Fixing Memory Leaks in Python
    2 people · 2 points · first shared 2009 · discussion on HN
  14. 14
    WSGI Production Setup: uWSGI, supervisor and nginx
    2 people · 1 points · first shared 2012 · discussion on HN
  15. 15
    Social programming should be a feature of a language
    2 people · 1 points · first shared 2009 · discussion on HN

What HN people wrote when they linked it

piqufoh · 2015-03-27
HN has a ranking system which differs to reddit etc. You'll be seeing what's "hot" as ranked by the algorithm http://amix.dk/blog/post/19574 If you're looking for what's popular, check out https://news.ycombinator.com/best
wikwocket · 2013-10-16
For interesting related reading, see this article on Hacker News's and Reddit's ranking algorithms: http://amix.dk/blog/post/19588 It links to this excellent read as well: http://blog.reddit.com/2009/10/reddits-new-comment-sorting-system.html
amix · 2012-10-17
Great comment! I did not watch that talk. But I did watch another talk by John Cleese on how to become more creative ( https://www.youtube.com/watch?v=kH8uYDJlwog - only 10 min). It's a very recommended watch as well. I especially like this quote: If you're racing around all day, ticking things off on lists, looking at your watch, making phone calls, and generally just keeping all the balls in the air, you are not going to have any creative ideas. - John Cleese A year or two ago I also did a presentation on how to become a more creative programmer where this quote is also included, the slides can be seen here http://amix.dk/blog/post/19599
jsdalton · 2010-12-16
Here's an excellent, detailed, and fairly recent explanation of the Hacker News ranking algorithm: http://amix.dk/blog/post/19574
r721 · 2015-10-07
They could just make 45 000 (in this formula: http://amix.dk/blog/post/19588) a used-defined parameter, the formula basically means tenfold increase in score should be approximately during 45 000 seconds (12.5 hours) for submission to stay. Make it 4 hours for those who want a less stale front page or even 2 hours.
manidoraisamy · 2015-09-20
pkrefta · 2015-07-29
Basic implementation of Reddit's Hot Order or something similar is pretty straightforward :) http://amix.dk/blog/post/19588
jewbacca · 2015-06-28
Was this story removed? It has more points than several older stories currently visible on the HN front page (and, for that matter, the next 5 pages after that), which, as far as I know [0], means it should be listed on one of those pages. But it's not. ---- [0] http://amix.dk/blog/post/19574
Rifu · 2015-06-04
I believe in this context it means that newer posts are ranked higher than older posts, which is pretty helpful in making sure the front page remains "fresh". [0] http://amix.dk/blog/post/19588 [1] http://www.outofscope.com/reddits-empire-no-longer-founded-on-a-flawed…
avargas · 2015-03-13
You could create something based off reddit's http://amix.dk/blog/post/19588
jlft · 2014-11-19
It could be "popularity" or "trending factor" instead. Basically the same way stories are ranked on HN (http://amix.dk/blog/post/19574), but instead of upvotes it uses our popularity score system.
woven · 2014-10-28
I'm not sure how HN does it specifically. In a version of our app, we had scoring which was initially modeled after Reddit's algorithm (http://amix.dk/blog/post/19588). A server task updated the scores for every item every hour. We could have limited how far back we went, but had no need in our case given that the amount we indexed was within reason. We'd add or subtract from the score based on a set of rules that considered a number of factors including posted date, number of votes and number of comments. We had an admin tool for assigning more or less weight to the various factors.
markcrazyhorse · 2014-07-10
This is how the Algorithm works: http://amix.dk/blog/post/19574
puppetmaster3 · 2014-04-11
Related to CloudFare, I know what a real CDN is, but I'm not sure what cloudfare does useful at all, ex: http://halfelf.org/2013/i-dont-understand-cloudflare http://pergento.wordpress.com/2012/02/01/cloudflare-slowed-down-our-si… http://amix.dk/blog/post/19627 Like they tell you to use CloudFare w/ a CDN. what? It appears that they are a good marketing company, and OK tech, but not clear to me what. Compare it to real CDN Fastly or MaxCDN. So other than marketing, what does Cloudfare do when you pay them?
roryokane · 2014-01-30
As far as I can tell, it’s based on a combination of upvotes and time since posting. New comments start at the top of their tree and, as time passes, settle into where they would be if sorted by upvotes. So yours is above the other one because it’s more recent, but in a week, if the upvotes don’t change, the other one will be on top. It’s probably a similar algorithm to Reddit’s published “hot” algorithm (http://amix.dk/blog/post/19588).
johnterry_cfc · 2014-01-23
This blog post seems to be explaining how reddit's algorithm works: http://amix.dk/blog/post/19588
thezilch · 2013-09-24
Specifically, the sorting algorithm as described by Edwin Wilson (1927) (http://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval#W… and a more technical digest of the Reddit implementation by Amir Salihefendic (http://amix.dk/blog/post/19588).
There is no manual approval. All links on the frontpage are there based on the amount of votes and time. http://amix.dk/blog/post/19574
Yes, I believe HN comment sorting uses the same algorithm as news items, where the score of an item is based on both votes and time, decaying over time. Description: http://amix.dk/blog/post/19574 Comment sorting: https://github.com/nex3/arc/blob/b78c7f/lib/news.arc#L2028-L2030
irahul · 2012-11-25
Previous discussions: http://news.ycombinator.com/item?id=1781013 http://amix.dk/blog/post/19574 The simplified algorithm is Score = (P-1) / (T+2)^G where, P = points of an item (and -1 is to negate submitters vote) T = time since submission (in hours) G = Gravity, defaults to 1.8 in news.arc The updated algorithm posted by pg has other factors, but those are related to quality control. If the same algorithm is still deployed, stories decline with time. So, during quiet periods, the new stories with far lesser number of votes rank higher than old stories with high number of votes.
weaksauce · 2012-11-20
Probably the algorithm, check out these(old) posts on it... http://amix.dk/blog/post/19574 http://news.ycombinator.com/item?id=1781013
cooldeal · 2012-10-18
The ranking algorithm is that simple. http://amix.dk/blog/post/19574 Watch articles that are critical of Apple or Google, or those are not critical of Microsoft, most of the time they get flagged down by overzealous fans. Edit: Happening right now to this very article :)
Permit · 2012-09-18
The longer a post has been around, the most points it requires to get to the front page. I believe this is still relevant: http://amix.dk/blog/post/19574 PG's post: http://news.ycombinator.com/item?id=1781417
ecesena · 2012-05-24
Mmm... not so sure. One of the nice features of reddit's algo is that it doesn't require to evaluate the score based on the current time, as this one. http://amix.dk/blog/post/19588 There are also a few similarities like max(abs(points+1),1), log base 10...
Fizzadar · 2012-05-24
The HN algorithm is outlined here: http://amix.dk/blog/post/19574
jwong42 · 2012-05-23
I bookmarked these articles when I was trying to search for algorithms to implement in a news website that I wanted to develop as a side project. But I haven't taken a closer look at them yet. Hope these help. http://amix.dk/blog/post/19574 - HN http://amix.dk/blog/post/19588 - Reddit
cd34 · 2012-04-17
http://amix.dk/blog/post/19574 probably one of the better analyses. Basically, time decay and velocity of votes affect the vote ordering. The older an article is, the more votes it needs to stay in the top positions. Therefore, the 304 points/15 hours and 122 points/9 hours have roughly the same weight as the 16 point/2 hour submission.
joshuahedlund · 2012-04-03
For those who do not understand the Wilson algorithm, see this post which was on HN recently, explaining how it works in a little more detail: http://amix.dk/blog/post/19588 (I agree with other commenters that it is complicated and lacks common sense to average users, but I feel like I have a general understanding of the concept thanks to the above link)

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close