164 days ago · Tech · hide · Fediverse post

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.

Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town