tags:

views:

183

answers:

7

As a non-english dude, I have trouble differentiating this.

When I try to translate this into my language, I get something weird like "go up" for ascending. So lets say I want to sort the names of all my pets alphabetically. I want that A comes first, then B, then C... and so on. So since the alphabet is not a number for me, my brain refuses to grok what's "going up". A = 0? B = 1? C = 2? If yes, then ascending would be what I'm most of the time looking for. Table would start showing A, then B, then C... Or is that the other way around? Must I look from the bottom of the table, up?

And with numbers: If it's an ascending order, the smallest comes first? (would seem logical...)

Can someone post a short but good example for what is an ascending sort order, and what is an descending sort order? And does that apply to whatever platform, programming language, API, etc.?

+6  A: 

Perhaps Increasing(Ascending) vs Decreasing(Descending) is a better way for you to think of it?

Joel Coehoorn
so ascending = increasing, descending = decreasing?
dontWatchMyProfile
Yes, clarified the answer.
Joel Coehoorn
+5  A: 

Perhaps this trick might help:


A scending

A BCD


D escending

D CBA

Stargazer712
Nice. At least for lexicographical ordering
BCS
True, but at least its a short jump to other forms of ordering from there.
Stargazer712
Maybe one of the best (besides the gal trick from Hamish) ...
dontWatchMyProfile
+1  A: 

Most of the time:

  • ascending : the order you would normally expect
  • descending : the reverse of what you would normally expect

Just think what order you would expect something to be sorted in if you just asked an intern to sort them without saying how. (numbers: smaller before larger, words: apathetically/lexicographically, etc.)

BCS
+1  A: 

Think of everything as a number... Characters are represented by numbers as well, so:

A = 5 B = 6

Descending is biggest number first. Ascending is smallest number first.

I always get confused with ASC/DESC for dates and times, however once you learn how datetime works, it's easy. A date is simply a number, it represents the number of seconds that have passed since a certain date, so the bigger the number is, the closer to now it is!

Tom Gullen
+2  A: 

I get something weird like "go up" for ascending".

It's not weird... that's exactly what ascending means: that goes up (comes from the Latin word ascendere).

So, for numbers is: 1,2,3,4,5 ... for letters is just alphabetical order: A, B, C, D...

nico
That A,B,C is "going up" is clear in English but it's very possible that that phrasing it complete nonsense in other languages.
BCS
@BCS: it's clear in any language that uses latin letters, as the order of the letters is always the same in all of them. Judging from his level of English (which I think is good, although I am not a native English speaker myself) I would guess he knows how to read a (Latin characters-based) dictionary...
nico
my point has nothing to do with having an ordering of letters, it has to do with groupings of concepts. A language could have a well defined order for it's alphabet but use different orthogonal terms for it than for the ordering of numbers: e.g. "A is to the left of B" vs. "1 is in front of 2"
BCS
@BCS: point given. Still it's easy to remember: ascending = increasing for numbers and alphabetical order for letters. Descending = the opposite. It's the default order in SQL queries as it is the default order for letters or numbers. I am not aware of any Latin-based language where the order of letters is different from A,B,C,....etc. I'll give you a point for certain letters, though. For instance Italian only has 21 letters (as it misses J, K, W, X, and Y).
nico
@nico: I'll grant your point as well (see my answer ;) OTOH, the way I generally figure out which is what I want is by running the code and checking it; if it's going in the wrong order, I switch to the other one.
BCS
+2  A: 
  • Ascending order of alphabets are like A, B, C, D . . . Z
  • Descending order of alphabets are like Z, Y, X, W . . . A
Joe
+2  A: 

Bothe are defined by the collation sequence on your system. See the defintion of collation sequence here for example http://www-01.ibm.com/software/globalization/terminology/cd.jsp#c02