Code Smell 24 - Boolean Coercions
Booleans should be just True and false
Accidental complexity coupled to one particular language.
Difficulty to hop among languages.
Work with booleans for boolean conditions. Not integers, not nulls, not strings, not lists. just booleans.
This is a language feature. Some strict languages show warnings with this magic wizardry.
Some languages encourage doing some magic abbreviations and automatic castings. This is a source of errors and a Premature Optimization warning.
We should always be as explicit as possible.
It is not the language that makes programs appear simple. It is the programmer that make the language appear simple!
This article is part of the CodeSmell Series.