5 ms·
I appreciate the idea, but the comma just looks horrible to me as part of a filename. I can imagine someone unfamiliar with the naming scheme to get confused.
by ndsipa_pomu 9mo ago
I appreciate the idea, but the comma just looks horrible to me as part of a filename. I can imagine someone unfamiliar with the naming scheme to get confused.
I'd prefer to use underscore (when writing BASH scripts, I name all my local variables starting with underscore), but a simple two or three letter prefix would also work. 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. (e.g. Comma is typically used as a list separator and it's a bit of cognitive dissonance to see it not used in that context)
- eterps 9mo agoI use my_ as a prefix.
- JamesTRexx 9mo agoWhenever I see "my" as a prefix, it feels like such a childish "my first Sony" thing. I hate official sites using that.
- SoftTalker 9mo agoThis was actually the same feeling I had when I tried to learn perl. I just had a visceral dislike for "my" as the keyword to declare a local variable.
- ndsipa_pomu 9mo agoI used to use "do" as a prefix e.g. "doBackup" Nowadays, I tend to skip using a personal prefix and just try to name commands with a suitable verb in front (e.g. "backupMySQL") and ensure that there's no name collisions.
- k3vinw 9mo agoThat’s a more meaningful prefix than “,” at the expense of a couple more key strokes. I consider that to still be a win in the book of tab completions. I would replace underscore with “-“ or “.”
- ndsipa_pomu 9mo agoI'd warn against creating files starting with "-" as that can lead to unexpected results with tools if you forget to use "--" to end options. Nothing wrong with using "my-" as a prefix though.
- layer8 9mo agoUnderscore 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.