Sometimes, software flags are created in a negative form. For example an indexing tool with a --skip-publish flag defaulting to false. Those flags are hard to reason about, because they are named in a negative form. --skip-publish=false is a double negative. Do not not publish -> Do publish. Having simply --publish=true would be way simpler! Some frameworks auto-generate the negation flag. creating --publish with a default true value would also create an opposite flag --no-publish. That's fine! But imagine if you create --skip-publish, and then your framework generates --no-skip-publish — Again, hard to use. A simple rule: Name your flags for positive actions, avoid double negatives.
No comments yet. Log in to reply on the Fediverse. Comments will appear here.