Most projects end up in crunch time. Here's a gem I ran across recently. I didn't look to see who did it (hey, it may have been me), but nevertheless it needed fixing (the code here is not verbatim, but the meaning remains)...
if (!someBooleanFunction(comparisonData1, comparisonData2)
{
return false;
}
else
{
return true;
}
- The if statement has the ! (not) operator. I find negative logic difficult to read
- This could have been solved by just doing a return on the output of the function!!
Cheers to good code!
jk