If I only want to check if something is impossible or not (i.e., I will not be using something like if(possible)
), should I name the boolean notPossible
and use if(notPossible)
or should I name it possible
and use if(!possible)
instead?
And just to be sure, if I also have to check for whether it is possible
, I would name the boolean possible and use if(possible)
along with else
, right?
You should probably use isPossible
.
Negative names for booleans like notPossible
is a very bad idea. You might end up having to write things like if (!notPossible)
which makes the code difficult to read. Don't do that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With