This is just bad code, as you say.
A "real" developer never writes if (condition == true), but onlyif (condition)
You can also record if (true == condition). This is called the Yoda style and is designed to prevent unwanted variable assignments if you mistakenly write =instead ==.
source
share