by derriz · 1y ago · 0 comments
But we have so many textual representations of numeric values that I'm assuming the "mind-reading" goodness only works for a small subset. And the subset will be somewhat intuitive for developers but unlikely to be so for non-technical people.
For example, does the order handle numbers with fractions (decimal points)? If yes, does it require a at least one leading digit (zero)? Does a.12345 come before or after a.345?
Does it handle thousand separators? What about international thousand and decimal separators (e.g. Euro-style . for thousand separation and , for decimal separation).
Does it handle scientific notation?
If the answer is no to any of these questions, it's likely to lead to surprise/confusion.
It's like a feature request that initially sounds reasonable and useful but once you explore the requirements in detail you realize there are too many edge cases to be able to meet the request in a non-brittle way.
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 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.
> traditional engineering degrees
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.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".
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.
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.
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.
Edit: for today's lucky ten thousand
Based on this description, I have no idea how the following would be sorted:
• photo.jpg
• photo1.jpg
• photo01.jpg
• photos.jpg
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.
my user expectation is the opposite
i get what you're saying but it's not achievable in practice, at least not consistently
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.
Yes. An algorithm must be unambiguosly specified for all possible inputs.
photo1 photo01 photo001 photo0001 photo2
So the shorter representation of the same number comes first. It does make intuitive sense to me.
> 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.
0 - https://man.freebsd.org/cgi/man.cgi?query=ascii&apropos=0&se...
I guess?
photo.jpg
photo[nine].jpg
photos.jpg
photos[zero][one].jpgThe specific option for numeric sorting is “kn”.
As far as I can tell, every operating system and many other interfaces tend to use this standard algorithm.
https://www.unicode.org/reports/tr35/tr35-collation.html#CLD...
Worse, if the answer is yes to any of these questions, it's also likely to lead to surprise/confusion. The only way to win is not to play.
The answer to all of those questions is no for lexicographic ordering. Lexicographic ordering leads to surprise and confusion as a result.
> It's like a feature request that initially sounds reasonable and useful but once you explore the requirements in detail you realize there are too many edge cases to be able to meet the request in a non-brittle way.
It's been on windows and macOS for coming up on 25 years, and is in practically every modern UI. It’s reasonable.
More to the point of the article--if you want things sorted by date, sort by date. I think most laypeople aren't looking at long CHAR1234_5678 filenames anyway, they're looking at thumbnails and dates.
Yes.
> Use any character in the current code page for a name, including Unicode characters and characters in the extended character set (128–255), except for the following: The following reserved characters:
< (less than)
> (greater than)
: (colon)
" (double quote)
/ (forward slash)
\ (backslash)
| (vertical bar or pipe)
? (question mark)
* (asterisk)
https://learn.microsoft.com/en-us/windows/win32/fileio/namin...
Unfortunately it doesn't work. When I copy the files, they all get new dates in whatever random order they happened to be copied in.
Proper fractional, 1.11 is smaller than 1.3.
In versions, 1.11 is larger than 1.3
The problem is that there is no such thing as natural, and it is quite hard to determine what is more common. (Quite often more common is culturally dependent or, worse, contex dependent).
Even though it increases the match between semantic meaning and string sorting in many important cases and is a simple and consistent rule?
Yeah, but there is such a thing as "give a predictable and consistent way I can name the files so that they sort as I want everywhere" which (if different OSes don't try to be "smart") would have been to prefix them with the numeric date zero padded.
The options explode infinitely if you start trying to guess what people want in terms of semantic grouping. One user might want to see "September Budget" beside "September Sales Projections" and "September Calendar", and another might want to group it with "October Budget" and "November Budget".
If you have simple, stupid, but predictable tools, people can work around that, by picking naming conventions and even directory groupings that achieve what they want.
The worst is when you have an enforced sort that's not what you want. I think in Windows now, even if you say "Sort by name" in the Downloads directory, it insists on sub-grouping by age. I want every version of the Foobaz spec I downloaded, and no, I don't remember if all of them were in the last 3 months!