Take the 2-minute tour ×
Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. It's 100% free, no registration required.

I don't understand the difference between ascending and descending? Surely ascending means the most active/recent/popular/A first, and descending means the least active/recent/popular/Z first?

But it seems it's the reverse in most API routes. (I think there are a few where it's different but I always find it hard to get my head around asc vs desc)

EG: http://api.stackoverflow.com/1.1/tags?order=desc&sort=name brings up results that start with Z

but: when using descending with date/activity sorted routes the most recent/active items are shown.

share|improve this question
    
+1 I never noticed this either. Tagging as a bug. –  Nathan Osman Mar 20 '11 at 19:42
add comment

1 Answer

up vote 3 down vote accepted

Dates increase as time advances, so 1293861600 (Jan. 1st 2011) is greater than 946706400 (Jan 1st. 2000). Thus, a descending ordering puts the most recent dates first.

Because sorting by dates is much more common than by name, ordering is descending by default.

share|improve this answer
    
Surely ascending means, as you go up the list the value gets greater? It doesn't say this in /usage –  Jonathan. Mar 21 '11 at 7:33
    
@Jonathan - that is what ascending means, and that's why the most recent dates are returned first in when order=desc; since they are larger than dates in the past. –  Kevin Montrose Mar 21 '11 at 15:49
    
ok I've just never understood ascending and descending I find they are uselessly indiscriptive and kind of generic. I'll just have to take 15 minutes to learn them. –  Jonathan. Mar 21 '11 at 15:57
    
I know I'm late, but I'll point out for the alphabet: think of it in ASCII (Unicode) numbering. Z is highest in number, while A is lowest in number. So a descending alphabet starts at Z and ends at A. –  Adam Dunn Mar 24 at 19:02
add comment

You must log in to answer this question.

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