Hacker News new | ask | show | jobs
by lblume 260 days ago
I also got used to it, but especially when writing short scripts that generate numbered files it gets annoying to have to pad with zeroes every time, and also precommit to a specific amount of digits you want to allow (finding a compromise between adding a ridiculous amount, like 20, and using only 4 despite knowing the script might one day surpass 10⁵ files).

The natural numbers are ordered. Let me use its ordering instead of having to rely on an ad-hoc lexicographic fixed-length tuple representation of decimal digits, without any padding. My position is that numbers in filenames should always be considered atomically unless explicitly instructed otherwise.

If there were no issues of backwards compatibility, I would thus advocate for changing ls. Eza (maintained fork of Exa, Rust-based ls alternative) actually does sort this way by default, much to my delight.