Live data from Hacker News

Dotfile madness (2019)

0x46.net

111–120 of 185 posts

Re: Dotfile madness (2019)

#111

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?

Hold your giggles until you learn that windows MAX_PATH is only 260 characters. Not just filename, the entire path.

Unless an app uses \\?\ prefixes and special API for navigation, which is rare, ime.

Re: Dotfile madness (2019)

#112
post #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 equ…

This sounds like “let’s design something nobody ever will use”. Compare how often you (or anyone) created, edited, deleted or backed up a ~/.dotfile vs some file who-tf-knows-where in AppData or Library mazes. These have near zero discoverability and expect-ability.

There are better alternatives

Let’s define “better” first.

Re: Dotfile madness (2019)

#113

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…

> Hiding hidden files is annoying because you have to add -a to ls command

Have you ever heard of aliases?

Re: Dotfile madness (2019)

#114
post #5

> You will most likely want to create a default configuration file with sane and sensible default values the first time your program is executed. Please don't. Include the example configuration in your docs (/usr/share/PROG..) and mention it in the manual. Statistically user will have hundreds of apps installed but will only ever customize a small fraction them. So creating config unconditionally on first run is one…

Also, idempotency of a tool is a desired property that tool devs often invest a lot of effort in maintaining. Initializing default config on the first run is a trivial way to break it.

It's much better to just have a sane implicit default value for each setting when config is not present. Then you can list the default config in your docs or offer a CLI flag --print-default-config or --copy-default-config.

Re: Dotfile madness (2019)

#115
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.

> When in Rome, do as the Romans do.

Yeah, but then again, when you visit Rome for a short vacation as a tourist, the English versions of menus and such help, no?

Just saying, some degree of consideration for non-natives is a good thing, as it will help the tourism business generate more revenue. Same for OSes: give me at least an option of staying with my old habits until I get used to the new ones, then there's a higher chance I'll switch.

Re: Dotfile madness (2019)

#116
post #20
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"

On the contrary, that's exactly what it's supposed to be.

Yes, for users who weren’t scared of .ssh and even edited its contents from time to time. Because these were just their files, not “junk from apps and configs that hurt my sense of beauty”. Those who want to live in a clean folder - mkdir it.

Re: Dotfile madness (2019)

#117

This problem can be solved by simply not storing anything in the home directory. Kepp your files in a separate directory like /data or /files and leave home directory for configs. Storing your files in /home is also bad because usually /home uses Linux-specific filesystem and you won't be able to access your files from Windows. Storing files in NTFS partition solves this problem.

What if another user wants to keep their personal files on a computer too? Create /data2? This is what /home/$USER/ is for.

Also, /home may be mounted anywhere, including some NTFS partition.

Re: Dotfile madness (2019)

#118
post #97

Surprised no one has mentioned nix home manager, which deals with dotfiles in an incredibly elegant way. https://github.com/nix-community/home-manager

I've open the project link, scanned the docs, I could not figure out where do find a general description of the problem it tries to solve, and the solution advantages.

You made me curious and didn't deliver ! The anguish !

Re: Dotfile madness (2019)

#119

People are simply just lead by example: ~/.bashrc, ~/.bash_profile, ~/.profile, etc.

The shell profile is a fundamental part of using a Linux computer. It affects how every single program is launched. This is not the same as a utility program's config file.

I don’t see how my prompt function or aliases are more fundamental than vim, git or other rc’s.

It affects how every single program is launched

That is true, but used as an argument for this subject is tangential and overblown. Look at your .bashrc and tell which parts are too fundamental to not be stored elsewhere, if really needed.

Re: Dotfile madness (2019)

#120
post #97

Surprised no one has mentioned nix home manager, which deals with dotfiles in an incredibly elegant way. https://github.com/nix-community/home-manager

I've open the project link, scanned the docs, I could not figure out where do find a general description of the problem it tries to solve, and the solution advantages. You made me curious and didn't deliver ! The anguish !

https://news.ycombinator.com/item?id=33313657
Post reply on HN