What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 150 Stack Exchange communities.

I just noticed that when you sort questions by votes, the questions with the same amount of votes are not ordered randomly.

I am not saying that this is bad or wrong, I just want to know what is the criteria to put one above the other(s)?

Also I am a bit curious on why they didn't apply the same feature that is being used to sort answers with the same amount of votes, is there a particular reason or they just forgot to apply it on questions too?

share|improve this question
Given all the irritations that random answer sorting has caused on (rare) questions with multiple pages of answers, I shudder to imagine the horrors that would result from applying it to questions... –  Shog9 Aug 5 '12 at 5:07
Good catch, couldn't see any pattern as well. Appears to be "fixed random", lol! –  Shadow Wizard Aug 5 '12 at 7:22
I'd expect it to be random, but cached. –  Oded Aug 5 '12 at 9:31
@Oded good point, this fits exactly. –  Shadow Wizard Aug 5 '12 at 10:45

1 Answer 1

up vote 7 down vote accepted

Here's the code from Marc's amazing tag engine when sorting by votes, where x and y are questions:

// question score desc
int delta = y.Score.CompareTo(x.Score);

// tie? then by aggregate answer score desc
if (delta == 0) delta = y.AnswerScore.CompareTo(x.AnswerScore);

// tie? fallback to question creation date desc
return delta == 0 ? y.Id.CompareTo(x.Id) : delta;
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .