by exceptione · 2y ago · 0 comments
Example. Is there something wrong in the following statement? You don´t know, because it does not specify what the intended meaning of the statement is.
if (foo.a <= 3 && bar || bar > 34 && ( ...etc ))
Take away: break up the parts of you logical condition, give them a name, reassemble the condition from the logically named parts. A a rule of thumb, a condition that reads like a regular sentence is a clear condition.No comments yet.