4 ms·
Underscore requires pressing Shift, however. > I don't like the idea of a punctuation prefix as punctuation usually has a specific meaning somewhere and includ
by layer8 9mo ago
Underscore requires pressing Shift, however.
> I don't like the idea of a punctuation prefix as punctuation usually has a specific meaning somewhere and including it as the first character in a filename looks wrong.
So you don’t use dotfiles? ;)
- ndsipa_pomu 9mo agoWell dotfiles demonstrate that punctuation can have a special meaning in filenames. I'm not convinced by "quicker to type" arguments as that's rarely the bottleneck, so I'm perfectly happy with using underscores in filenames and variables. I wouldn't use underscore as the beginning character of a filename unless it had a specific meaning to me (e.g. temporary files), so I'd be more inclined to use a two or three character prefix instead.
- layer8 9mo agoFor me it’s not about quickness, but about strain. Like in RSI.
- necovek 9mo agoOn non-English keyboards (Serbian/Croatian/Slovenian, but as they are based on QWERTZ, I imagine German and possibly others too), both "+" and "-" might not require pressing Shift either, and are much better characters than comma.
- layer8 9mo agoThese are inconvenient for doing anything with the script files except invoking them, because these characters introduce command-line options.
- necovek 9mo agoWhich was the point here, wasn't it? Script files that you will be commonly running and only editing rarely, I'd optimize for how easy they are to run, not operate other commands on them from within a shell.
- ndsipa_pomu 9mo agoNaming a file with a "-" as the first character means you have to be careful to use "--" with commands to signify the end of options as otherwise the filename will be interpreted as being additional options with unexpected results. e.g. ls -l -- * Even when you're not deliberately operating on the commands, it's too easy to get caught out by it with wildcards etc.
- necovek 9mo agoSure, but this would be contained to when your CWD is ~/bin or ~/.local/bin (or wherever you put your "-" scripts in).
- ndsipa_pomu 9mo agoYes, but it doesn't make it a good idea to leave potential traps lying around even if they're in a different room.