1

Most application I usually install (opam, cargo, vscode, julia, ...) keep a local storage in my home folder. Is there a reason for this preference? Or better, are there downsides to the alternatives?

For example sometimes it is suggested that such files should be located on /var, or in ~/.local/share, but there might be issues or annoyances in using these folder in "cross-distro" application.

Do you know any such possible issues?

[any answer o any of the three questions i asked here would be satisfactory]

1
  • I selected the appdata tag by mistake; this question has nothing to do with that %appdata% but i don't know how to remove it...
    – afiori
    Commented Feb 8, 2018 at 16:47

1 Answer 1

1

In a Google+ post by Rob Pike, A lesson in shortcuts, is given this explanation :

Long ago, as the design of the Unix file system was being worked out, the entries . and .. appeared, to make navigation easier. I'm not sure but I believe .. went in during the Version 2 rewrite, when the file system became hierarchical (it had a very different structure early on). When one typed ls, however, these files appeared, so either Ken or Dennis added a simple test to the program. It was in assembler then, but the code in question was equivalent to something like this:

    if (name[0] == '.') continue;

This statement was a little shorter than what it should have been, which is

    if (strcmp(name, ".") == 0 || strcmp(name, "..") == 0) continue;

but hey, it was easy.

Two things resulted.

First, a bad precedent was set. A lot of other lazy programmers introduced bugs by making the same simplification. Actual files beginning with periods are often skipped when they should be counted.

Second, and much worse, the idea of a "hidden" or "dot" file was created. As a consequence, more lazy programmers started dropping files into everyone's home directory. I don't have all that much stuff installed on the machine I'm using to type this, but my home directory has about a hundred dot files and I don't even know what most of them are or whether they're still needed. Every file name evaluation that goes through my home directory is slowed down by this accumulated sludge.

I'm pretty sure the concept of a hidden file was an unintended consequence. It was certainly a mistake.

(For those who object that dot files serve a purpose, I don't dispute that but counter that it's the files that serve the purpose, not the convention for their names. They could just as easily be in $HOME/cfg or $HOME/lib, which is what we did in Plan 9, which had no dot files. Lessons can be learned.)

So what I understand is that :

As these "dot files" became invisible, other programmers jumped in and decided that the place to store their precious configuration data was in dot files right along with the . and .. files. As in the beginning file hierarchy was not very evolved, they all ended up in the $HOME directory, and pretty quick this became an unwritten convention to which everybody conformed, following in the steps of the founding fathers.

This gave rise to such monstrosities as :

image

Reference :

Linux History: How Dot Files Became Hidden Files

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .