The sort rules are simple (1). Treat any consecutive sequence of digits as a number when sorting. So for example version numbers (which must be massively more common than decimals in filenames) work correctly, and 5.9 is indeed smaller than 5.10 and the latter is not identical to 5.1 .
Given that this idea goes back more than two decades, has been the default behaviour of the most used OSes for many years, with no major outcry, I think empirically we can be fairly certain that it does not routinely lead to a lot of surprises and confusion.
In considering the simplicity of the rule, I think you're using a developers perspective here where we automatically classify numbers and have a clear mental model of the separation between value and representation.
But I'm not sure how simple it would be to explain to a non-technical user why size_5, size_10 and size_15 are in order but size_0.25, size_0.5 and size_0.75 are out-of-order.
> with no major outcry
I'm regularly amazed at how little non-developer/technical users complain about strange and confusing behavior.
> I'm regularly amazed at how little non-developer/technical users complain about strange and confusing behavior.
I am a highly technical user that works with a lot of people with traditional engineering degrees but little to no software experience (except as frequent users). The answer here is that they've learned that all computer software is arcane and mysterious, and so they just accept that there will be strange patterns they have to pick up on, and that's their role as a user. They don't complain about strange and confusing behavior because they treat all the behavior as strange and confusing.
What does that mean? What disciplines? I cannot believe that all junior graduates in engineering disciplines in the 2020s are not doing some programming, even if just writing macros in a CAD program.
Most of the people I work with are 35+, but even the juniors in MechE, Aero, etc. tend to have some scripting experience that doesn't necessarily translate to having a robust intuition about DBs, the relationship between frontend and backend design, etc.
> I'm regularly amazed at how little non-developer/technical users complain about strange and confusing behavior.
Because EVERYTHING a computer does to non-developer/technical users is "strange and confusing". With few exceptions, most people have no idea why their computer does something the way it does, or how they could make it do something different even if they wanted it to. And most of the time, when they complain about it to someone knowledgeable the answer will be some variant on "that's just sort of the way it is". Imagine a world where the names are sorting the way that the OP is looking for, you're still having to explain to someone why the first group sorts "out of order" and the second group sorts "in order". And if they complained, they would almost certainly get an answer that is some variant on "that's just sort of the way it is".
And if you explain in detail about how it works, a lot of people (not all, but quite of few of the more obstreperous types who raise these as CRITICAL BUGS with solutions apparently SO SIMPLE MY DOG COULD IMPLEMENT IT) will then say "I don't know why you have to make it all so complicated, things were simpler and better in v(n-12) in 1997".
If you add an option you're making it more complicated, harder to document and less discoverable, if you don't it's "useless", if you use a heuristic it's "too magical". Eventually someone has to be unhappy.
> But I'm not sure how simple it would be to explain to a non-technical user why size_5, size_10 and size_15 are in order but size_0.25, size_0.5 and size_0.75 are out-of-order.
You don't have to explain it if the situation never comes up.
I'd bet 99.9% of computer users don't have any files which would trigger this edge case in a situation they would actually notice. Decimals just aren't that commonly used in this context, and even if you do have decimals the sorting will still work a lot of the time. For the remaining 0.5%, chalk it up to a bug.
I literally had to test this on my Mac just now because I never realized it was broken.
> I'm regularly amazed at how little non-developer/technical users complain about strange and confusing behavior.
It reminds me of the recent article here titled something like "Altoids by the mouthful". We just get used to eating cat poop and we never realize it is not a good idea to eat cat poop, not that we should make it more palatable by chasing the cat poop by chewing Altoids by the mouthful.
There's a user expectation that photo20.jpg comes after photo3.jpg.
There's no user expectation around whether photo1.jpg or photo01.jpg comes first. Just like there's no user expectation around whether photo1.jpg or Photo1.jpg comes first. Users also don't have the slightest idea about what order punctuation gets sorted in.
Just sort the things that matter in the way users expect (natural sort order) and come up with something reasonably consistent for the rest.
> There's a user expectation that photo20.jpg comes after photo3.jpg
I expect photo20.jpg to come first.
> There's no user expectation around whether photo1.jpg or photo01.jpg comes first.
Clearly photo01.jpg comes first.
> Just like there's no user expectation around whether photo1.jpg or Photo1.jpg comes first.
Of course Photo1.jpg comes first because uppercase comes before lowercase.
It really sounds like you're using the word "user" to mean "dumb" and I wonder, what got you to the point that you started considering yourself an expert on "dumb" and feeling the need to defend "dumb" ?
I'm sorry but it all comes off so condescending, like "users" are a different+lower species or something.
> An algorithm must be unambiguosly specified for all possible inputs.
And it is. It's just that some outputs may not match what the user expects. TFA's preferred algorithm (simple lexicographic sorting) matches user expectations 90% of the time. The algorithm actually in use on most OSs (simple lexicographic sorting + treat consecutive digits as combined numbers) matches expectations 99% of the time. An algorithm that matches expectations 100% of the time doesn't exist. Shouldn't we pick the 99% algorithm?
(I am admittedly making up the actual percentages, but you get the point.)
I get your point but I still disagree (also about the percentages btw). Can you also get _my_ point?
Well-designed machines quite _often_ operate against "user" expectations when those expectations are wrong.
For instance say if I charge my phone for an hour, it'll last for a day. How long will it last when I charge it for two hours? Because in practice the answer is either "also a day" or it is "the battery catches on fire", this machine acts _against_ user expectations and stops charging the phone after an hour.
Maybe an even better example: coins! I dunno about coins in the US but but get this: the 5 eurocent coin is _bigger_ than the 10 eurocent coin! I dunno why, or if there even is a good reason for that, but it doesn't seem to bother "users" of money (e.g. everybody) when they have to sort out cash.
Anyway my point is that even if _some_ (but definitely not all!) people may expect numerical sorting, doesn't mean that they're right ... and it's not like lexicographic sorting is rocket science and zero padding .. well I think you said you don't like the way it looks, but I actually think it looks very neat because things line up and it's actually easier to read for me, as well :)
It's dumbing things down, in a bad way. It's like hiding the inner workings of stuff, and it's a mistake to think that even if somebody is not familiar with computers that they are _stupid_. People might even get curious and figure out that numbers come before uppercase and those come before lowercase. And maybe one day someone comes along and says "you know that's because of ASCII?" and they learn a thing! Which is cool.
Instead it's like you're painting people scratching their heads wondering "why number not go up?"
But did it show as a list or an ordered collection of folders? And the second time you opened the folder did it rearrange into a haphazard scattering with items off the edge of the window?
> I just tried it on Mac, its sorted in the order you listed. Extending it a bit, the order is:
> photo1 photo01 photo001 photo0001 photo2
What you enumerated is known as "ascending lexicographical ordering" and has nothing to do with "the shorter representation of the same number", but instead the ASCII[0] character values in each file name.
Given that this idea goes back more than two decades, has been the default behaviour of the most used OSes for many years, with no major outcry, I think empirically we can be fairly certain that it does not routinely lead to a lot of surprises and confusion.
(1) https://en.m.wikipedia.org/wiki/Natural_sort_order