When defining a Boolean (true/false) variable or property
- Prefix the name with "Is" or "Has"
- Do not negate in your variable name.
Bad Boolean variables names:
- Allowed (No prefix)
- IsNonUser (Negated Name)
- IsNotAllowed (Negated Name)
- Permission (No prefix)
Good boolean variable names:
Because if statements with negation become easier to read.
I think this if statement is harder to read
Then this if statement