Say I have a function with a flag 或 something:
void foo (Param p1, Param p2, bool setVariable)
{
//if setVariable is true, set some bool var to true, else false
}
是否有强烈的优待?
if (setVariable)
_someClassVariable = true;
else
_someClassVariable = false;
或
_someClassVariable = setVariable;
Obviously the second is less typing, but the first strikes me as m或e readable. Which one would be preferred?