Live data from Hacker News

Dotfile madness (2019)

0x46.net

101–110 of 185 posts

Re: Dotfile madness (2019)

#101

What I personally find more egregious are dotfiles and dot-dirs on Windows , created by half-baked ports of Unix-first software (such as `ssh`). Windows has `%APPDATA%` and `%LOCALAPPDATA%` that are accessible with `ShGetKnownFolderPath`[0], using the appropriate `KNOWNFOLDERID`[1]; all programs should put their configuration and cache data in these paths. Windows also doesn't know what the dot at the beginning of a…

Is “..” the official way to get a parent directory on Windows? Or do they have some other API and the “..” is just a nod to UNIX compatibility?

It seems the only official native API for getting the parent directory from a known (full) path is PathCchRemoveFileSpec. But certainly C# and other similar platforms have functions doing similar things, and usually don't require a system API call anyway, it's just string manipulation - unless of course the path is relative to the current directory.

Re: Dotfile madness (2019)

#102
post #99

I do not understand the problem with "dot"-files. And I do not understand the benefit to have them in another directory. I think there are more important problems to solve in this world.

Are there more important things to solve? Of course.

However, this particular topic on this particular message board is about dotfiles and the alternatives.

Dotfiles are a clumsy mechanism that came from the early days of Unix.

There are better alternatives that provide the same lack of "unknown/unnecessary" directories and files in the user's home directory/folder.

Each of Windows/MacOS/XDG-compliant OSs has the equivalent of:

1. A configuration directory 2. A storage directory that is maintained between user logins and/or application execution 3. A temporary/cache directory that is not guaranteed to be maintained between user logins or application execution.

The different languages/runtimes also have ways of retrieving these locations which are cross-platform but return the correct values and should be used by all applications that are written to modern standards.

Re: Dotfile madness (2019)

#103

Earlier quoted context omitted.

I think "hidden" files are a bad idea. What's the point of hiding some of the files in a directory from user? It only makes things more confusing. For example the folder might look empty but in fact it could contain thousands of hidden files. You want to delete it as it is empty but accidentally delete important system files. Even worse, imagine if all files on an USB drive are marked as hidden. You see that the driv…

>What's the point of hiding some of the files in a directory from user? It only makes things more confusing. If a user doesn't know what .ssh/ or .bash_history are, and it can hurt them to accidentally delete or modify them, why show them by default? It's like training wheels on a bike. >For example the folder might look empty but in fact it could contain thousands of hidden files. You want to delete it as it is empt…

> If a user doesn't know what .ssh/ or .bash_history are, and it can hurt them to accidentally delete or modify them, why show them by default?

Because they are there. To prevent accidental deletion you can show an icon with a skull and crossbones or name a directory "configuration files" so that it is obvious what's in there.

> if they do get them there is no safeguard to stop them destroying the system

If the folder are named or labeled as "operating system" then the user will probably understand that it is better not to mess with it.

> In what reality is someone developing software and building Docker containers who doesn't understand the concept of hidden files?

Hiding hidden files is annoying because you have to add -a to ls command, have to add an option in Bash to include then when matching against a star pattern and to configure Explorer so that it shows them. It would be easier without them.

Re: Dotfile madness (2019)

#104

Earlier quoted context omitted.

I think "hidden" files are a bad idea. What's the point of hiding some of the files in a directory from user? It only makes things more confusing. For example the folder might look empty but in fact it could contain thousands of hidden files. You want to delete it as it is empty but accidentally delete important system files. Even worse, imagine if all files on an USB drive are marked as hidden. You see that the driv…

i just always list dotfiles for years now.. and my IDEs too. mostly a non issue.

And I have to enable showing them on every system I work with (and add -a to every ls command, and google which option enables incldues them in pattern expansion). That is annoying.

Re: Dotfile madness (2019)

#105
post #8

The solution is simple, stop messing your home and put personal data in /home/you/personal/ source code in /home/you/src/ The home is not a place supposed to store random "regular files"

Probably not in the roots home directory? ~/me/ feels good.

Re: Dotfile madness (2019)

#107
post #53

Earlier quoted context omitted.

I prefer the app placing the config in the same place on every system. It makes it easier for me to find the file regardless of OS (to modify or back up with a script) and it's simpler for the app dev to write the code for as well. I recognize this is probably because I first learned about config files on a Unixy system, it's not the "native way" for Windows, and other people have stronger cases for their preference,…

Your argument breaks down even between 'Unixy' systems. Linux programs that follow the XDG base directory specification write to those, whereas macOS programs tend to write to ~/Library/Preferences or ~/Library/Application Support, neither of which exist on Linux, or even BSDs. When in Rome, do as the Romans do.

I’m a Roman and have no clue what these AppData/Romaning are for. Dotfiles that I’m aware of are my files and I expect them to reside in my ~ atrium.

Re: Dotfile madness (2019)

#108

Earlier quoted context omitted.

>What's the point of hiding some of the files in a directory from user? It only makes things more confusing. If a user doesn't know what .ssh/ or .bash_history are, and it can hurt them to accidentally delete or modify them, why show them by default? It's like training wheels on a bike. >For example the folder might look empty but in fact it could contain thousands of hidden files. You want to delete it as it is empt…

> If a user doesn't know what .ssh/ or .bash_history are, and it can hurt them to accidentally delete or modify them, why show them by default? Because they are there. To prevent accidental deletion you can show an icon with a skull and crossbones or name a directory "configuration files" so that it is obvious what's in there. > if they do get them there is no safeguard to stop them destroying the system If the folde…

> To prevent accidental deletion you can show an icon with a skull and crossbones

This will make users more likely to delete it thinking it's a virus.

> If the folder are named or labeled as "operating system" then the user will probably understand that it is better not to mess with it.

Big assumption that most people know what an operating system is.

Re: Dotfile madness (2019)

#109

Earlier quoted context omitted.

I think "hidden" files are a bad idea. What's the point of hiding some of the files in a directory from user? It only makes things more confusing. For example the folder might look empty but in fact it could contain thousands of hidden files. You want to delete it as it is empty but accidentally delete important system files. Even worse, imagine if all files on an USB drive are marked as hidden. You see that the driv…

>What's the point of hiding some of the files in a directory from user? It only makes things more confusing. If a user doesn't know what .ssh/ or .bash_history are, and it can hurt them to accidentally delete or modify them, why show them by default? It's like training wheels on a bike. >For example the folder might look empty but in fact it could contain thousands of hidden files. You want to delete it as it is empt…

> If a user doesn't know what .ssh/ or .bash_history are, and it can hurt them to accidentally delete or modify them, why show them by default? It's like training wheels on a bike.

You have permissions to prevent from accidental deletions.

Re: Dotfile madness (2019)

#110

Earlier quoted context omitted.

I don't find it egregious at all. Nobody should go out of their way to integrate with Windows APIs when files work just fine everywhere.

The reason app developers think it's fine to dump them in $HOME is because Linux hides them. Those app developers do not bother hiding them on Windows. The specific functionality being used does not 'work just fine everywhere'. It is not the case that Linux functionality is How Computing Works with every deviation being 'out of the way', not even in a hypothetical world where Linux isn't the drastic minority of machi…

Regular windows users do not visit $HOME often either. They work mostly in Desktop, Documents and Downloads. They can’t even “go up” from these anymore for more than a decade. None of the non-tech users I know would even understand me if I told them to look at their homedir. So yeah, it’s fine regardless.

Btw, many native, no-linux windows apps, including Microsoft ones love to create their bs folders like “My Games”, “Microsoft Visual Studio (c)(tm) Pile of Whatever” or “Android Projects” right in ~/Documents. This “way” is unenforceable even in OS’es own company.

Post reply on HN