4 ms·
> some have hardcoded those paths in other scripts My sympathy is lacking, as is my respect for those running projects that hardcode paths. Stop hardcoding pat
by brigandish 4y ago
> some have hardcoded those paths in other scripts
My sympathy is lacking, as is my respect for those running projects that hardcode paths. Stop hardcoding paths and the world will be a better place.
- ajsnigrutin 4y agoeg. ~./bashrc has existed there for 30+ years, changing stuff just because someone doesn't like seeing a file in a folder is imho stupid.
- chungy 4y agoA hidden file, even. Stop using "ls -A" and you'll be fine.
- superluserdo 4y agoTo be pedantic, if we're going to cite Unix history, then technically there is no such thing as a "hidden" file. As I understand, the original implementation of tools like ls would not show the current directory "." in the listing. The quickest way of doing this in C was checking whether dentry.name[0] == '.' This also had the side effect of hiding entries that had names beginning with ".", and over time an implementation bug/quirk became accepted behaviour, and was post-hoc rationalised as "hidden" files.
- xolox 4y agoWho cares how the feature of hidden files came to be, when it has been what it is now for so many years?
- brigandish 4y agoAs a defence of hardcoded paths might go, I could've done better myself. What else from your OS 30 years ago might you keep just because it's 30+ years old?
- ajsnigrutin 4y agoI keep it because it's worked for 30 years without issues and it's still working. Must you always replace something, just because a newer thing is "out there"? On the other hand, this is hackernews, and rewriting everything, from a text editor to a file browser, into a <language of the week> (ruby, go, rust,...) is a thing.
- Jorengarenar 4y agoOr perhaps Bash for 30 years was using a sub-optimal solution and now when a better approach has emerged it just stubbornly refuses to adapt?
- brigandish 4y agoTry moving all of those directories and files somewhere else that you would prefer and then see which programs break, which apps and libraries won't install, and then wonder why hardcoding is something the devs for these projects cling to.
- hyperupcall 4y agoI'd say bashrc and profile and friends are one of the few examples in which using hardcoded paths is OK. Same with SSH, GPG, and PAM. But when people are talking about compliance, and hardcoding very few people are talking about those applications - there are hundreds of other applications do the wrong thing, and some scripts hardcode things as a result.
- iforgotpassword 4y agoNo, but don't keep doing it that way for new software, or even new files. You existing config file is in ~ because it's 30 years old. Fine. If you get to the point where you need another file for something, put it in a directory under .config so whenever you need to add even more, you don't keep cluttering my home.
- YeGoblynQueenne 4y agoHome is where the .bashrc is <3