Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Maybe it's just me but I don't miss this at all:

  Image-1.jpg
  Image-11.jpg
  Image-2.jpg
The only time natural sort bit me was with nonsensical names like <md5>.jpg


Nah that's not just you. That is an unnatural way to sort things because that's not how numbers are ordered. I remember when Windows changed to sorting numbers by their value and, despite my programmer brain finding it strange in a way, I was super happy to have files display in an order that actually made sense.


I think it depends on the person. That order is exactly what I expect and want.


Same here. I was surprised at everyone here who prefers the more-complicated-but-arguably-more-intuitive lexical sort. Naive alphabetical sorts break some expectations, but don't produce any weird edge cases.

I wonder if there's an age divide at play here, where those of us who grew up with the naive alphabetical sort prefer it.


More importantly, it is how computers work, and how computers have worked for many decades.

Anyone with experience expects them to work this way. Trying to be clever to cater to the inexperienced only harms both groups.


Computers have been sorting with natural sort for decades. By now, it is "how computers work".

Were you under the impression this was something new?


I was very surprised by it when I noticed it a year or so ago. What's interesting is that when it works, eg you have a directory with numbers from 1-10, you don't really notice it. It isn't until it bites you in the ass, eg your downloads folder with a bunch long numeric strings, some in hex, where you want to find one and suddely it's not where you expect.

I used a gui software some years ago that distinguished between version sort and alphabetic sort. It would be handy to have a toggle.


You prefer looking at photos in that weirdly particular shuffled order that isn't the order they were taken in?


The mistake is software which doesn't follow a recognized standard for date/time representation in its filenames. Ie, RFC 3339, ISO8601 or their union/intersection[1] (but preferably just ignore ISO8601 because its overcomplicated and RFC3339 is simpler and more intuitive).

In OP's examples, the filenames are YYYYMMDD_hhmmssssss, which is neither valid ISO8601 nor valid RFC 3999, as the former doesn't accept underscores (only 'T'), and the latter doesn't accept basic format dates (YYYYMMDD), only the equivalent of extended format (YYYY-MM-DD).

And if dates in file names simply used the extended format, the problem disappears. The lexical order is the natural order.

Alternatively, file managers that treat any digits as a number should be improved to recognize when a sequence of digits is not actually a number but a date/time, and order those chronologically. This might occasionally produce a few false positives, but I'd suspect it would be a rare occurrence.

[1]:https://ijmacd.github.io/rfc3339-iso8601/


If I want to sort by date, I sort by the "Date" column, not the file name


I hope you don't ever copy files.


I copy files all the time? I have files in my documents folder with creation dates in the 90's that have been copied forward between many computers.


Or edit any files with historical data.


Creation Date and Modification Date are separate


If I wanted to sort by date taken I would do just that using the EXIF data on them.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: