Live data from Hacker News

When I say “alphabetical order”, I mean “alphabetical order”

sebastiano.tronto.net

291–300 of 385 posts

Re: When I say “alphabetical order”, I mean “alphabetical order”

#291
> I miss the time when computers did what you told them to, instead of trying to read your mind.

This could be an illusion, or at least something difficult to evaluate; the operator is less likely to notice the situations when the computer successfully “reads their mind”.

Also, I guess new users (i.e. those unfamiliar with previous behavior) won’t care as much about wrong assumptions; they will only learn that one doesn’t need a leading zero.

Re: When I say “alphabetical order”, I mean “alphabetical order”

#292

I am surprised how many people are comfortable calling sorting numbers alphabetical sorting (including TFA). In true alphabetical sorting, sorting numbers is undefined behaviour. Both of these sorting methods are valid extensions of alphabetical sorting, and which you prefer is just that: a preference. So actually when he says ‘alphabetical order’, he does not, in fact, mean ‘alphabetical order’.

Yes. This is called ”natural order”.

Re: When I say “alphabetical order”, I mean “alphabetical order”

#293
post #283

Earlier quoted context omitted.

Do I understand that you want these to be sorted like this? 1 2 9 10 11 So I guess you also want things sorted like 1.1 1.2 2 9 9.9 And also 1 1.1 1.10 1.2 1.10.1 So when you're done defining whatever crazy rules you think up, how do I pause whatever and edit the filenames to get them back into lexicographical order? You can massage lexicographical to meet your needs. I can't massage your arbitrary rules to meet my n…

Your examples don’t need any extra rules to be sorted correctly. The basic idea is that any sequence of digits is treated for sorting as if it were a single character. On my iPhone, your examples are sorted as expected.

Would you sort

  1.10
  1.2
or

  1.2
  1.10
?

I would not know how an OS treats those if we do not assume mindreading vs proper lexicographic order. Why would we need to substitute precision with vagueness for something that simply taking care of proper naming would suffice?

Re: When I say “alphabetical order”, I mean “alphabetical order”

#294
post #283

Earlier quoted context omitted.

Your examples don’t need any extra rules to be sorted correctly. The basic idea is that any sequence of digits is treated for sorting as if it were a single character. On my iPhone, your examples are sorted as expected.

Would you sort 1.10 1.2 or 1.2 1.10 ? I would not know how an OS treats those if we do not assume mindreading vs proper lexicographic order. Why would we need to substitute precision with vagueness for something that simply taking care of proper naming would suffice?

[deleted]

Re: When I say “alphabetical order”, I mean “alphabetical order”

#295
post #283

Earlier quoted context omitted.

Your examples don’t need any extra rules to be sorted correctly. The basic idea is that any sequence of digits is treated for sorting as if it were a single character. On my iPhone, your examples are sorted as expected.

Would you sort 1.10 1.2 or 1.2 1.10 ? I would not know how an OS treats those if we do not assume mindreading vs proper lexicographic order. Why would we need to substitute precision with vagueness for something that simply taking care of proper naming would suffice?

Ah yes sorry, 1.10 comes after 1.2 because 10 is bigger than 2 (so in fact different from your example). But assuming your original list is a list of versions (which seems reasonable given the presence of multiple decimal points for some cases), then that’s the order you’d want.

If you have non-integer numbers in your filenames then it won’t give the order you want, but there isn’t going to be a rule that works for all cases.

Re: When I say “alphabetical order”, I mean “alphabetical order”

#296

I agree with Microsoft/Google/KDE's order. The author's situation is extremely rare, and the situation where someone wants "10" to be before "9" is far more common. Moreover, desktops don't label this sorting "alphabetical" (E: and it would really be "lexicographic"*), they label it "by name" (an informal criteria), so technically they're not lying. > I miss the time when computers did what you told them to, instead…

"mind-reading" is a really an unfortunate term though. Every algorithm is a strict and consistent set of rules that tries to serve the needs of its users. No magic is ever involved.

It is just that some users have conflicting needs and some sets of rules are more complex than others. So I think what this really is about is 'computer reading', the needs of some users to be able to predict with ease what the computer is going to do. Some people would rather be able to predict the computer doing something that they actually don't really need, and then make up for its shortcomings, than have something they feel they cannot predict and control, but is actually closer to what they want.

This is a bit like the term magic. Any sufficiently complex algorithm may indistinguishable from mind-reading, but it's still an algorithm. Mind-reading, like magic, depends on us being able to understand or not, which is highly subjective. But both are misleading terms.

Re: When I say “alphabetical order”, I mean “alphabetical order”

#297

I agree with Microsoft/Google/KDE's order. The author's situation is extremely rare, and the situation where someone wants "10" to be before "9" is far more common. Moreover, desktops don't label this sorting "alphabetical" (E: and it would really be "lexicographic"*), they label it "by name" (an informal criteria), so technically they're not lying. > I miss the time when computers did what you told them to, instead…

I will add that I'm plenty "smart" enough to understand that "10" comes before "9" in a strictly alphabetical sense, and I still want my file managers to sort "9" before "10". I don't want to put leading zeroes before every all the single digit numbers in my file names. (And then potentially go come back later and add even more leading zeroes once the maximum number reaches three digits.) --- I split all of my audiob…

> I will add that I'm plenty "smart" enough to understand that "10" comes before "9" in a strictly alphabetical sense

Strictly speaking 9, 1 and 0 are not in the alphabet so can't be sorted alphabetically.

And I think most "normal users" wouldn't expect that programmers generalize the alphabet like we do.

Re: When I say “alphabetical order”, I mean “alphabetical order”

#298
post #107
post #89

Earlier quoted context omitted.

And where do you sort the letter ä? (After a is correct in German, but I think Swedish does it differently.)

That's why we have all this LC_* stuff in Linux, which you can configure to your needs: export LC_MEASUREMENT="de_DE" export LC_MONETARY="de_DE" export LC_PAPER="de_DE" export LC_CTYPE=de_DE.UTF-8 export LC_MESSAGES="en_US.UTF-8" export LC_RESPONSE="en_US.UTF-8" export LC_TIME=en_US.UTF-8 Mix in your Swedish or Swaheli, maybe even the Vatican State: e.g. de_DE, sw_TZ, it_VA (not guaranteed ;-).

> export LC_TIME=en_US.UTF-8

Why would you do this to yourself?

Re: When I say “alphabetical order”, I mean “alphabetical order”

#299
> I miss the time when computers did what you told them to, instead of trying to read your mind.

You haven't seen anything yet. Get ready for "Sort by AI" which will try to interpret the content of your images to sort them based on what you'll want to look at next.

Incidentally, in this case AI would have sorted them the way you want:

   These look like photos straight from a phone, with filenames in the form:

   IMG_YYYYMMDD_HHMMSS...

   So the natural way to sort them is *chronologically*, by the timestamp embedded in the filename.

   If we do that, the order becomes:

   1. `IMG_20250820_055436307.jpg` — Aug 20, 05:54:36
   2. `IMG_20250820_092016029_HDR.jpg` — Aug 20, 09:20:16
   3. `IMG_20250820_092440966_HDR.jpg` — Aug 20, 09:24:40
   4. `IMG_20250820_092832138_HDR.jpg` — Aug 20, 09:28:32
   5. `IMG_20250820_095716_607.jpg` — Aug 20, 09:57:16
   6. `IMG_20250820_103857_991.jpg` — Aug 20, 10:38:57
   7. `IMG_20250820_103903_811.jpg` — Aug 20, 10:39:03

   That order reflects the actual sequence the photos were taken.

Re: When I say “alphabetical order”, I mean “alphabetical order”

#300
post #150

Earlier quoted context omitted.

You don’t let every decision to the user, you make good defaults, but leave the option to override to the user! And thousands isn’t scary as long as groups/tags/search work, so what’s ridiculous about empowering the user?

Increasing the number of different possible combinations of settings your software can be running with by a factor of one nonillion is not a choice I’d make if I wanted to have any confidence in its reliability and security.

That's why you write small programs. It won't take long for most programs to bloat to the level where they're dealing with nonillions of combinations, whether the user has control over those combinations or not.
Post reply on HN