A
Andre Anneck
Hi there,
lately I have been involved in a discussion that ended unsatisfactory
from my point of view... I couldn't argue against: "Common literature
discusses the same problem and the majority of the resources come to
the conclusion that the "==" comparator should be avoided if you
compare with a boolean."
Example:
if ( on ) <--// Supposedly literatur say's so.
if ( on == true ) <--// Supposedly literatur say's NOT to use this.
As you can see this drills down to readablity and maintainability.
My Problem is that IMHO having the "==" in place makes code more
readable and robust against change-bugs. Sadly the other guy is in
charge, but could'nt name any books to enlighten me :-/.
Now since I would like to understand his argument before I decompile
it ...
Can anyone of you point me to literature reference that discuss this
topic AND give out the rule-of-thumb to avoid using "==" with
booleans?
Take care,
André
P.S.:
And yes, it's only about Java not C/C++/*any* Naming-Conventions.
lately I have been involved in a discussion that ended unsatisfactory
from my point of view... I couldn't argue against: "Common literature
discusses the same problem and the majority of the resources come to
the conclusion that the "==" comparator should be avoided if you
compare with a boolean."
Example:
if ( on ) <--// Supposedly literatur say's so.
if ( on == true ) <--// Supposedly literatur say's NOT to use this.
As you can see this drills down to readablity and maintainability.
My Problem is that IMHO having the "==" in place makes code more
readable and robust against change-bugs. Sadly the other guy is in
charge, but could'nt name any books to enlighten me :-/.
Now since I would like to understand his argument before I decompile
it ...
Can anyone of you point me to literature reference that discuss this
topic AND give out the rule-of-thumb to avoid using "==" with
booleans?
Take care,
André
P.S.:
And yes, it's only about Java not C/C++/*any* Naming-Conventions.