12

TL;DR: instead of merely sorting answers by all-time score, add another way to favor answers which were upvoted recently to appear on top.

The problem

Imagine following situation: A question is asked on Stack Overflow. It's a good, on-topic, well-researched question, so it quickly gets upvoted. It also quickly gets an answer, which technically works, but is bad, because uses bad programming practices, obsolete technologies and may not work in specific conditions.

Example: for question "how to access a variable by string name in JavaScript?" answer "use eval("someVariable")" undoubtedly would be bad, but this wouldn't prevent people from upvoting it, especially if there was no better answer.

Three years passes, the bad answer reaches 100 upvotes, and someone with a deeper knowledge on this topic decides to post an answer. Since this answer is better, it theoretically should get upvoted and rise to the top. Well, it looks a bit different in reality. How many people actually scroll down to the second answer, when the top answer appears to be working? It's almost impossible for the good answer to outscore the bad, because most people still would only read the top answer and upvote it.

I assume that OP of the question is either inactive, so they can't accept the good answer to make it appear at the top, or still thinks that the top answer is the best, or simply doesn't care. This unfortunately happens very often.

The solution

Instead of all-time upvotes, let's analyse the last 20 upvotes on a question's answers. If the top answer gets most of them, for example more than 12, it usually means that it's still the best answer. However, if the second top answer gets more than 8 upvotes, it's a strong indication that it's better than the top answer and should be displayed first. Since the answers further down the page are much less likely to receive upvotes, if the top 10 answer gets more that 4 upvotes, it's also very likely that it's better than the top answer.

So, instead of sorting answers based on all-time votes, use more complex algorithm, which would take only recent votes and weight votes based on answer's position. It could be something like recentVotes * sqrt(position). If a question had answers with following recent votes:

# | all time votes  |  recent votes
------------------------------------
1 | 100             | 8
2 | 30              | 6
3 | 10              | 1
4 | 5               | 5

It would be sorted like that:

# | all time votes  |  recent votes  |  recentVotes * sqrt(position)
-------------------------------------------------------------------
4 | 5               | 5              | 10
2 | 30              | 6              | 8.49
1 | 100             | 8              | 8
3 | 10              | 1              | 1.73

Of course the algorithm could be a little different, that's just a basic idea. Also, at first this sorting method should be an alternative to the existing default vote sorting. If users like it, we can make it the default sorting.

Example questions which would benefit from this sorting system:

  • How to prevent form from being submitted? From 2016-01-26, the day I started discussion on Meta about this question, my answer changed score from 0 to 38. This answer, which was accepted at this time, changed score from 90 to 88. So with the new sorting algorithm, my answer would be now displayed as the second, instead of the third.

  • What does the construct x = x || y mean? From 2016-01-10, the day I posted my answer, it changed score from 0 to 5 (by the way, it also received a 500 reputation bounty from Madara Uchiha, which is a good reason to display it closer to the top). It's now top 5 answer, so with my algorithm it would have score equal to 11,18. The top 4 answer received one upvote and one downvote, so it score didn't change. With my algorithm it would have score equal to 0. The same is with the top 3 answer, and similar with the top 2 answer (it received 2 upvotes and 2 downvotes). Therefore, with the new sorting algorithm, my answer would be displayed as the second, instead of the fifth.

  • Find object by id in an array of JavaScript objects. From 2016-02-14, the day I posted my answer, it received 4 upvotes. It's now the top 14 answer, so with my algorithm it would have score equal to 14,97. This answer received 6 upvotes, and it's top 6, so it would have score equal to 14,70. This answer received 8 upvotes and 2 downvotes, and it's top 2, so it would have score equal to 8,49. So, my answer would be the second instead of the fourteenth. And also the current top 6 answer would be the third.

This feature request is similar to Feature request: introduce an optional sort option for answers that lets new good answers rise faster to the top, but I don't think it's a duplicate.

Related on MSE:

18
  • @ryanyuyu at first this sorting method should be optional, but if users like it, we can make it default So it would be a new sorting tab, the default would still be the same. After some time, if users would use it a lot, we could make it default. Mar 31, 2016 at 12:39
  • Why does a question getting votes more recently then an another answer make it more valuable then that other answer? In your example the answers with 5 and 30 votes may have some useful information but not be nearly as useful as the answer with 100 votes. Something new might have given a different way to answer the question, someone posted it attracting upvotes and the original answer likely wont attract new upvotes even with the new info.
    – Joe W
    Mar 31, 2016 at 12:41
  • I'm a little confused where exactly this sorting of answers would happen? If it it is in the question itself, wouldn't the fact that the accepted answer remains locked at the top basically make it a fruitless effort?
    – Gimby
    Mar 31, 2016 at 12:42
  • @JoeW Well, as I wrote, most users read only the top answer and upvote it, so if despite this some answer at the bottom receives relatively many upvotes, it's very likely that it's better than the top answer. Mar 31, 2016 at 12:45
  • @Gimby Sometimes there is no accepted answer, and even if, there's a great difference between some good answer being the tenth and the second displayed answer. Mar 31, 2016 at 12:47
  • So they should just read an answer that may not be the best? There is no reason to suggest that an answer with 5 votes (all of them recent) is better one with 100 votes and all of them old. Doing this would not solve the problem of only looking at the top most answer and can make it harder for people to find the real answer to the question because it is now buried newer posts that don't fully solve the problem and the user might not even want to upvote at all because they don't fine it useful.
    – Joe W
    Mar 31, 2016 at 12:48
  • @JoeW Why do you think that an answer which doesn't fully solve the problem would get upvoted at all, when the top answer is good? Mar 31, 2016 at 12:53
  • Because it can provide useful information and because people upvote crap.
    – Joe W
    Mar 31, 2016 at 12:58
  • @Gotho exactly, keyword: "sometimes". But in the scenario you sketch that answer with 100 upvotes most likely is an accepted answer. Just to note: I am in no way apposed to this request, but I just believe the issue of accepted answers behaving the way they do would need resolving first before it can really be of any help.
    – Gimby
    Mar 31, 2016 at 13:01
  • @JoeW It would be deleted before it could get upvoted, because someone would flag it as NAA, since answer which doesn't fully answer a question should be rather a comment or an edit to existing answer. Mar 31, 2016 at 13:02
  • 1
    NAA flags are not valid for answers that partially answer a question as they are still answers even if they are not great answers. Suggesting people use a flag like that is not a good thing to do.
    – Joe W
    Mar 31, 2016 at 13:14
  • Can you provide some sample questions/answers where this new sorting system would be better then the existing system?
    – Joe W
    Mar 31, 2016 at 21:54
  • @JoeW I added examples of three of my answers which would be displayed much closer to the top with this sorting system. Apr 1, 2016 at 9:48
  • Not to be cynical but it seems you want your answers to be more visable so that they have a better chance of getting votes. If you really want to show how this could be useful it might be best to show examples that are not posted by yourself.
    – Joe W
    Apr 1, 2016 at 11:24
  • @JoeW It was just easier to me to find answers of mine which would be good examples than looking at some random questions. I will happily make these answers CW if this sorting system gets implemented. Apr 1, 2016 at 14:48

0

You must log in to answer this question.

Browse other questions tagged .