4 ms·
"Dot" files are a terrible idea to begin with. It began as a dirty hack in "ls", in order to skip displaying "." and "..", it looked only at the first characte
by rollcat 2y ago
"Dot" files are a terrible idea to begin with.
It began as a dirty hack in "ls", in order to skip displaying "." and "..", it looked only at the first character of a file name. Exact string comparison is costly, and early UNIX could not afford that price.
Then people noticed that other ".whatevers" will also be "hidden", unless "-a" is specified.
Then it snowballed into hell.
Both Plan 9 and OS X tried to fix it, with "~/lib" and "~/Library" respectively, but especially as the latter was and is a certified UNIX, there's no avoiding a hundred random dot files and directories. I try to delete stuff I know I won't need again but...
$ uname
Darwin
$ ls -a | grep '^\.' | wc -l
61
Twenty of those were important enough for me to put them in version control, the rest is random crap. Even Hammerspoon, a *native* Mac app that hooks itself deeply into the OS APIs, uses its own dot directory.
Advice for all programs: follow the XDG spec[1]. Advice for OS vendors: default them to something more reasonable; ~/Library sounds appealing since we already use ~/Desktop, ~/Downloads, and so on.
[1]: https://specifications.freedesktop.org/basedir-spec/latest/ https://specifications.freedesktop.org/basedir-spec/latest/