

Sorting for Humans: Natural Sort Order - nickb
http://www.codinghorror.com/blog/archives/001018.html

======
BrandonM
Insightful comment buried in the middle of the noise:

If you listen, normal people have novel ways of thinking about computers that
are completely natural and that we've entirely lost sight of from long habit.
When I was teaching my Mom to use a computer (a Mac) I had a hard time
explaining to her why she couldn't name all her pictures of me "Jerry." "Well,
if they were all named Jerry, how would the computer know which one you
meant?" "Why, the one I just clicked on, of course," she said, giving me a
funny look. After all, the images have icons that are thumbnails of their
contents, so it's perfectly obvious to her which one she wants!

And you know, that sort of logic is very hard to refute, and it's perfectly
feasible for a GUI-driven computer to work that way. Now, programmers
understand why any chunk of data that needs to be accessed needs a unique key,
and find that natural, but that key doesn't necessarily need to be the file's
name, nor does the name need to be the primary way users identify files. Every
file has an inode number or other unique file system identifier anyway that
could be used behind the scenes, and that's actually a more persistent way to
refer to the file programmatically than the name (which is why the Mac uses it
for aliases).

My mom did eventually accept that each file in a folder needed a unique name
and that if she wanted to merge two folders she might have to rename some
files to avoid losing them entirely, which of course, if you think about it
from her perspective, is a dumb outcome from a dumb requirement. So now she's
one of us.

Naturally, it was also obvious to her how files should sort, and I was happy
to install an extension that did that for her on her Mac OS 9. At least I
could solve that problem.

Jerry Kindall on December 13, 2007 08:51 AM

------
Tichy
Hm, I don't quite get it: in his examples the ASCII sort order is also the
alphabetical sort order: z1, z100, z11 IS alphabetical, or am I missing
something? Where there is an issue with ASCII vs alphabetical is capital
letters, ASCII would be a,b,A and alphabetical would be A,a,b? (not sure if
a<A or A<a).

Now, should Microsoft be commended for guessing that the user probably wants
to sort the files by trailing numbers? I honestly think not. Usually it is
exactly that kind of thing, Microsoft kind of guessing what the user wants to
do, that drives people mad and makes them hateful towards Microsoft. This
particular case looks good on paper, but at the end of the day, the algorithm
is making things behave in an unexpected way.

