3 ms·
Don't use long flags when scripting, if they have short equivalents, and POSIX only specifies the short equivalents. Even if the stuff will only ever run on on
by kazinator 6y ago
Don't use long flags when scripting, if they have short equivalents, and POSIX only specifies the short equivalents.
Even if the stuff will only ever run on one system, the POSIX flags (1) come from a smaller set of options, since POSIX is fairly conservative in its content this area and (2) are generally well known (often three decades old or older).
Don't make me read a man page to confirm that "grep --fixed-strings" really is the same thing as the POSIX-standard "grep -F", and not something subtly different.
- maxioatic 6y agoWhy not just "man grep | grep -- --fixed-strings" real quick?
- kazinator 6y agoThese real quick moments add up to wasted time real quick.
- khalilravanna 6y agoWasted time for someone who has all of these memorized. How about all the future wasted time of people having to look up the flags cause they’re not explicitly spelled out? I’m in favor of explicitness because it saves time for future people and gatekeeps less.
- kazinator 6y ago-F is explicitly spelled out. Proof: I can see it. Explicit is the opposite of implicit, and implicit doesn't mean "abbreviated to a single character that is plainly visible". You don't necessarily know what a long option means without looking it up, just because it is long. Firstly, if your native language isn't English, you may have to look it up in a dictionary. The ordinary meanings you find there may not reveal what that word means in the context of the program. So, at that point you're off to the documentation anyway. I know what "hard" and "soft" are. Therefore, is it obvious what "git reset --soft" means? Hardly. Once you know what it means, "--soft" jogs your memory by association a lot better than some "-X". So that would seem like it is less cognitive work. But when we have long options, it encourages the option vocabulary of a program to keep growing, which adds to the cognitive load.