Both “11” and “11.” are strings, because the context is listing filenames. Filenames are not numbers. They are strings. If you sort filenames by number, you are asking the computer to interpret the string as having a number inside it. At worst, it might interpret “11” as an integer and “11.” as a floating point number, because that syntax is often used to specify a floating point number in programming. But even then, it could still sort them correctly.
I don’t mean to start an argument, but as a professional programmer, there are just some things that I know.
Are you intentionally ignoring that the actual names of the files are “11. EpisodeEleven.mp3”? There’s whitespaces and a bunch of letters there.
I’m also a professional programmer, and assuming that sorting by numbers code would try to grab the first block of strings until the first whitespace is a big assumption I would not make. I’d say that after trying to convert everything but the extension to a number for sorting it failed so it defaulted to string sorting for everything else.
You explaining that you would only do a numerical sort when the basename of the filename is entirely a number, as if your logical sense translates into a good user experience, is exactly why companies have to hire UX designers instead of just programmers.
If you have Windows 10, I suggest that you play around with filenames with numbers in file explorer and see how they’re sorted. Your intuition does not match the average user’s expectations in this circumstance.
I know it doesn’t, I was countering your logic of “I’m a professional programmer” as if the correct interaction would be obvious to a programmer. The intended interaction requires extra thought and to be more through than the obvious one, as you have described.
Both “11” and “11.” are strings, because the context is listing filenames. Filenames are not numbers. They are strings. If you sort filenames by number, you are asking the computer to interpret the string as having a number inside it. At worst, it might interpret “11” as an integer and “11.” as a floating point number, because that syntax is often used to specify a floating point number in programming. But even then, it could still sort them correctly.
I don’t mean to start an argument, but as a professional programmer, there are just some things that I know.
Are you intentionally ignoring that the actual names of the files are “11. EpisodeEleven.mp3”? There’s whitespaces and a bunch of letters there.
I’m also a professional programmer, and assuming that sorting by numbers code would try to grab the first block of strings until the first whitespace is a big assumption I would not make. I’d say that after trying to convert everything but the extension to a number for sorting it failed so it defaulted to string sorting for everything else.
You explaining that you would only do a numerical sort when the basename of the filename is entirely a number, as if your logical sense translates into a good user experience, is exactly why companies have to hire UX designers instead of just programmers.
If you have Windows 10, I suggest that you play around with filenames with numbers in file explorer and see how they’re sorted. Your intuition does not match the average user’s expectations in this circumstance.
I know it doesn’t, I was countering your logic of “I’m a professional programmer” as if the correct interaction would be obvious to a programmer. The intended interaction requires extra thought and to be more through than the obvious one, as you have described.