Sunday, October 13, 2002 |
02:32 - Now that's a sort routine.
|
(top) |
Get a load of this:
See that? The filename sort algorithm in OS X (and presumably dating back to 1984) isn't just by ASCII values, like in UNIX, or by case-insensitive alphanumeric ordering, like in Windows. It's smarter than I'd even realized.
Normally, if you want to sort files in a folder in a certain way, you figure you've got to give them numbers: "01", "02", "03", and so on. You have to use a leading zero because otherwise the order would go like this:
1 10 11 12 13 2 3 4...
...As though the filenames were textual strings. This is how an OS like Windows or UNIX would sort the files, by their respective austere string-based lexicographies.
But the Mac knows, apparently, that if you begin a filename with a number, then you intend for the files to be sorted numerically rather than alphabetically. So even though some of these files in the screenshot don't have a leading zero, it still sorted them in numerical order. The way I'd wanted.
Oh, and note the kerning on "08. Attack of the Saucer Morons.mov"... it's tighter spaced than any of the other filenames, so it can fit into the column. Resize the column (with the little thumb control under the scroll arrows), and the text will expand to normal size, smoothly, or jump to an ellipsis if you shrink it too much.
Speaking as a software engineer, that shit's hard. You don't do that kind of stuff unless you have to-- or unless you're driven by a psychotic desire to make everything rock.
If you're only coding to the bare minimum standard that you can get away with, you end up with sort algorithms like "List all subfolders first, before any regular files" and "Convert all all-caps filenames to initial-caps, regardless of whether it might actually be an acronym". Yeah, I love having folders named "Html" and "Www".
Lack of love for one's craft pisses me off.
UPDATE: It would seem that Windows XP fixes the initial-caps thing as well as implementing the numerical-sort-in-context thing. Well, hallelujah.
By the way, Kevin has reminded me of iTunes' behavior-- not only does it combine vowel variations (so that Bjork and Björk are treated as the same artist), but it also ignores the word "the" in artist and album names for sorting purposes, so "The Cure" is listed with the C's instead of with the T's.
|
|