Code Smell 62 - Flag Variables
Flags indicate what happened. Unless their name is too generic.
Use meaningful names
Try to avoid flags. They generate coupling.
We can search all the code for bad named flags.
Flags are widespread on production code. We should restrict their usage and use clear and intention revealing names.
If you lie to the compiler, it will get its revenge.
This article is part of the CodeSmell Series.
Flags cause me to flip out. I had the unfortunate experience of refactoring another developer's work that had a function with 7 input flags. The whole thing could've been achieved with a single Enum.