aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/blog/2025-09-28-alphabetic-order/alphabetic-order.md16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/blog/2025-09-28-alphabetic-order/alphabetic-order.md b/src/blog/2025-09-28-alphabetic-order/alphabetic-order.md
index 262a0d8..17ab685 100644
--- a/src/blog/2025-09-28-alphabetic-order/alphabetic-order.md
+++ b/src/blog/2025-09-28-alphabetic-order/alphabetic-order.md
@@ -1,11 +1,11 @@
1# When I say "alphabetic order", I mean "alphabetic order" 1# When I say "alphabetical order", I mean "alphabetical order"
2 2
3Last month I have been on a multi-day hike with my dad. Each of us took 3Last month I have been on a multi-day hike with my dad. Each of us took
4many pictures, and when we came back we put them all in a shared folder. 4many pictures, and when we came back we put them all in a shared folder.
5We both have Android phones, and the naming scheme used for our pictures 5We both have Android phones, and the naming scheme used for our pictures
6was the same: `IMG_YYYYMMDD_HHmmss` followed maybe by some other numbers 6was the same: `IMG_YYYYMMDD_HHmmss` followed maybe by some other numbers
7and then a `.jpg`. Here `YYYY` stands for the year, `MM` for month and 7and then a `.jpg`. Here `YYYY` stands for the year, `MM` for month and
8so on, so that sorting the pictures in alphabetic order is the same as 8so on, so that sorting the pictures in alphabetical order is the same as
9sorting them by date. 9sorting them by date.
10 10
11Or so I thought. Strangely, when I looked at the files from my dad's 11Or so I thought. Strangely, when I looked at the files from my dad's
@@ -32,7 +32,7 @@ Indeed, KDE's Dolphin file manager does the same thing:
32![Screenshot from Dolphin](dolphin.png) 32![Screenshot from Dolphin](dolphin.png)
33 33
34I'll spare you the screenshots, but Gnome and both the file managers 34I'll spare you the screenshots, but Gnome and both the file managers
35that I have on my phone also get the alphabetic order wrong. 35that I have on my phone also get the alphabetical order wrong.
36 36
37At this point I thought that maybe one of the two phones is using some 37At this point I thought that maybe one of the two phones is using some
38weird alternative unicode character instead of the underscore `_`. Really, 38weird alternative unicode character instead of the underscore `_`. Really,
@@ -60,17 +60,17 @@ other hand, this makes it harder to debug what the fuck is going on with
60all the other file managers. 60all the other file managers.
61 61
62It took me more than a month to figure this one out. Tell me, which 62It took me more than a month to figure this one out. Tell me, which
63file do you think comes first in alphabetic order, `file-9.txt` or 63file do you think comes first in alphabetical order, `file-9.txt` or
64`file-10.txt`? 64`file-10.txt`?
65 65
66Of course, the user who named those files probably wants `file-9.txt` to 66Of course, the user who named those files probably wants `file-9.txt` to
67come before `file-10.txt`. But `1` is smaller than `9`, so `file-10.txt` 67come before `file-10.txt`. But `1` is smaller than `9`, so `file-10.txt`
68should be first in alphabetic order. Everyone understands that, and 68should be first in alphabetical order. Everyone understands that, and
69soon people learn to put enough leading zeros if they want their files 69soon people learn to put enough leading zeros if they want their files
70to stay sorted the way they like. 70to stay sorted the way they like.
71 71
72Well, apparently all these operating systems have decided that no, 72Well, apparently all these operating systems have decided that no,
73users are too dumb and they cannot possibly understand what alphabetic 73users are too dumb and they cannot possibly understand what alphabetical
74order means. So when you ask them to sort your files alphabetically, 74order means. So when you ask them to sort your files alphabetically,
75they don't. Instead, they decide that if some piece of the file name is 75they don't. Instead, they decide that if some piece of the file name is
76a number, the real numerical value must be used. 76a number, the real numerical value must be used.
@@ -78,7 +78,7 @@ a number, the real numerical value must be used.
78I don't know when this became the norm, to be honest I have not used a 78I don't know when this became the norm, to be honest I have not used a
79normal graphical file manager in a long time. 79normal graphical file manager in a long time.
80 80
81*I know you asked for the files to be sorted in alphabetic order, 81*I know you asked for the files to be sorted in alphabetical order,
82but you don't want `file-10.txt` to come before `file-9.txt`, do 82but you don't want `file-10.txt` to come before `file-9.txt`, do
83you? No, I know you don't. I am not even going to ask you, your 83you? No, I know you don't. I am not even going to ask you, your
84mushy human brain is too small to comprehend the intricacies of 84mushy human brain is too small to comprehend the intricacies of
@@ -89,7 +89,7 @@ name right after the seconds, while mine added an extra underscore to
89separate them from the seconds. Which in my mind it should not have 89separate them from the seconds. Which in my mind it should not have
90mattered, because alphabetically they should still have been sorted 90mattered, because alphabetically they should still have been sorted
91correctly to the second. But with this "modern" interpretation of the 91correctly to the second. But with this "modern" interpretation of the
92alphabetic order, the files without the extra separator in the name had 92alphabetical order, the files without the extra separator in the name had
93a much higher number, so they come last. 93a much higher number, so they come last.
94 94
95Now that I know what the issue is, I can solve it by renaming the files 95Now that I know what the issue is, I can solve it by renaming the files

Generated with cgit - Back to sebastiano.tronto.net