Not operator is our friend. Not not operator is not our friend

Problems
Readability
Solutions
Name your variables, methods and classes with positive names.
Sample Code
Wrong
Right
Detection
This is a semantic smell. We need to detect it on code reviews.
We can tell linters to check for Regular Expressions like !not or !isNot etc as a warning.
Tags
Readability
Conclusion
Double negation is a very basic rule we learn as junior developers.
There are lots of production systems filled with this smell.
We need to trust our test coverage and make safe renames and other refactors.
Relations
Code Smell 24 — Boolean Coercions
Booleans should be just True and falsemedium.com
Code Smell 07 — Boolean Variables
Using boolean variables as flag, exposes accidental implementation and pollutes the code with Ifs.medium.com
Code Smell 06 — Too Clever Programmer
Code difficult to read. Tricky with names without semantic. Sometimes using language’s accidental complexity.medium.com
More info
What exactly is a name? — Part II: Rehab
We all agree: a good name is always the most important thing. Let’s find them.medium.com
Remove Double Negative
You have a double negative conditional. Make it a single positive conditional Double negatives are often frowned on by…refactoring.com
Knot-of-nots: Avoiding negative names for boolean methods
Better practice for naming methods that returns booleanlevelup.gitconnected.com
It’s harder to read code than to write it.
Joel Spolsky
Software Engineering Great Quotes
Sometimes a short thought can bring amazing ideas.medium.com
This article is part of the CodeSmell Series.
How to Find the Stinky parts of your Code
The code smells bad. Let’s see how to change the aromas.medium.com