6 ms·
This got me to raise an eyebrow: if [[ -d "$HOME/dev/go" ]]; then export GOPATH="$HOME/dev/go" fi Using a directory named "dev" not to store d
by jzzskijj 7y ago
This got me to raise an eyebrow:
if [[ -d "$HOME/dev/go" ]]; then
export GOPATH="$HOME/dev/go"
fi
Using a directory named "dev" not to store device files, but development tools. I am so stuck with conventions.
- enriquto 7y agoTrue! Also the mixing of upper and lower-case directories on ~ is a red flag. Offtopic, but this kind of one-line conditions are typically best written as test -d ~/dev/go && export GOPATH=~/dev/go then it is easier tho change the sign of the condition (by using either || or &&)
- toxik 7y agoA "red flag" for what? He's using macOS, in which the typical user-facing directories are propercase (/Users, ~/Documents, etc.)
- enriquto 7y agoI don't know, it's just very ugly and it lacks a sense of aesthetics (just like everything else on macos, so at least it is consistent). It's like reading a book that uses three different fonts on each page. You just cannot take it seriously.
- shrimp_emoji 7y agoletter cases were a mistake in language itself. cool way to bloat your glyph set to double the size and introduce aesthetic and string matching problems.
- laumars 7y agoRelated fact: the term "case" dates back to the old printing presses where characters would be individual blocks or wood or metal and they were stored in draws. Capital letters were stored in the draw above non-capital letters -- hence why they are referred to as "upper case" and "lower case". In terms of your general point, upper and lower case letters were originally different stylistic type-faces rather than "modes" of a letter in the same type-face. It wasn't until relatively recently in our writing history that the rules of capital letters became defined rather than a style choice and I'm certain they weren't thinking much about the problems that might cause with string matching on digital systems invented several hundred years later.
- siffland 7y agoI dislike CaMelcAse as well, but to each his own, I have stuff backed up from my windows machine on my BSD machine that has spaces and uppercase i leave it in case i need to restore. It does not mean you cannot take it seriously. MacOS is one of the few registered UNIX systems out there (https://en.wikipedia.org/wiki/Single_UNIX_Specification#macOS https://en.wikipedia.org/wiki/Single_UNIX_Specification#macO...). I actually do not own a Mac, but it is a decent OS and performs well and tries to be windows friendly (hence camelcase and spaces) and tries to be stable and secure.
- andrepd 7y agoAren't you being a little over-dramatic? I use Uppercase directories (Documents, Downloads, Development) in my ~ as well, in a consistent manner. Why is that ugly?
- toxik 7y agoI guess the downvotes tell you how other hackers feel about your opinions.
- sneak 7y agoFile systems on macOS are case insensitive. The system-provided directories are capitalized by convention, but you may also refer to them in lowercase if you like. It’s no more a “red flag” than `c:\WINDOWS` being capitalized. I opt for the if-brackets rather than the one line syntax because it is clearer to read. “if this, then that” is less mental effort than remembering just how boolean operators short circuit, for me at least. It's a few extra lines but I prefer the layout, indent, and ease of scanning.
- saagarjha 7y ago> File systems on macOS are case insensitive. Not all of them. You can choose to have a case-sensitive filesystem if you’d like.
- sneak 7y agoAs of about five years ago, enabling that feature at mkfs time broke tons of apps that assume case insensitivity. Not sure if the situation has improved.
- ImprovedSilence 7y ago> File systems on macOS are case insensitive. Holy smacks, all these years and I never knew that! Too bad auto-complete doesn't pick up on it though.
- xyzzy99 7y agoIt can. Try: set completion-ignore-case on (for bash).
- flukus 7y agoWindows now has optional case sensitivity on a per directory level. Drove me crazy trying to work out errors in an old c# codebase after a git checkout in wsl, multiple rounds of screaming THE FILES RIGHT THERE!
- yesenadam 7y ago
- dhagz 7y agoI don't like it either, but that's an artifact of using macOS - most users aren't fully aware of Linux naming conventions.
- sneak 7y agomacOS also uses /dev for device nodes.
- yjftsjthsd-h 7y agoIt's not a Linux convention, it's a Unix convention.
- sneak 7y agoI justify it to myself as “$HOME is different.” My fingers are also fast at typing it, and my brain is very well adjusted to “I am unprivileged” xor “I am root” - dev means vastly different things in those contexts, just as rm -r does.
- jzzskijj 7y agoIndeed, if it works for you, then it is good. In 1990's I used to have ~/dev in school's Sparcs running SunOS, as I needed some device files that weren't available in /dev. But I was able to mknod them. I've been also toying with chroots quite a lot and there dev is also quite essential for its original purpose. Therefore "dev" is like a reserved keyword for me in *nix systems. Personally I use ~/w (like "work") or ~/code mostly. I've had ~/dev once for storing projects, but I had to rename it as it was distracting (to me) :)
- iandinwoodie 7y agoThis is a point of conflict for me. I use "~/dev" for all of my development work, but I don't want to because of the convention set by "/dev". My problem is finding an alternative to "dev" that is just as convenient. Do any of you have any suggested alternatives?
- lelandbatey 7y agoI've always found myself using `~/projects/` for my development. It's also general enough that I can put not-quite-software projects like this in there: https://github.com/lelandbatey/custom_cpu--ALU https://github.com/lelandbatey/custom_cpu--ALU
- jayrhynas 7y agoI just use ~/Developer - with tab completion it's not really any harder to type. (And on macOS ~/Developer automatically gets a unique icon in Finder)
- dfinninger 7y agoI usually use "~/repos". That makes "re<tab>" a one hand movement in one direction. Most everything I do development-wise is in Git, which is why I came to that name years ago. I also have a "~/tmp" directory for one-off dev stuff that I clean up periodically.
- spatulon 7y agoI use ~/code
- guytv 7y agoI Use ~/src for ad-hocs and ~/git to home all of the git projects
- mxuribe 7y agoI use ~/ops ...but not in the "operator" sense. Rather, the "operations" sense...and that is because i used to use ~/projects...But i got lazy to type that out.
- 7y ago