Truely false

Just started working on a codebase where one of my predecessors consistently uses the following construct when testing if a Boolean variable is false:

if ((someBooleanVariable.toString().equals("false")) == true) { }

Beautiful, isn't it?


Anonymous said...

Jesus Christ :-|

Mastermnd said...

Unfortunately, you are not alone. I have also seen this (and other horrendous malpractices) happen.

<sarcasm>Now I just wonder, why didn't they use regular expressions instead</sarcasm> LOL.