2 ms·
Exactly. Naming the constituting parts also makes it clear if there is a bug. Example. Is there something wrong in the following statement? You don´t know, bec
by exceptione 2y ago
Exactly. Naming the constituting parts also makes it clear if there is a bug.
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.