I hate negative booleans.
If any time, for any reason, you need to use a boolean variable (very common), please always think in positive.
You don’t know how many brain cells I have wasted interpreting code like this:
# Declare variable
no_update = True
# Use variable
if not no_update:
do_something()
I mean… why not just write it like this?
# Declare variable
update = False
# Use variable
if update:
do_something()
And time and again I keep on seeing that pattern… Seriously, always be positive
please. And if you need to negate it, then just put a not
operator in front of it,
that’s why they exist for!