T
The Last Danish Pastry
I came across this piece of C# code today in a real application...
--------------------------------------
if (boolVal == true)
{
return true;
}
else
return false;
--------------------------------------
I was impressed by the amount of sheer ineptitude that the author of
the code had managed to squeeze into just a few lines.
# Why the blank line before "return true;"?
# Why are there braces around the if-part but not the else-part?
# The variable name, boolVal, is wonderfully uninformative.
# Why did the author write "(boolVal == true)" rather than just
"(boolVal)"?
# And, of course, why didn't the author replace the whole thing by
"return boolVal;"?
So far I have not been able to summon up enough courage to study the
rest of the program.
--------------------------------------
if (boolVal == true)
{
return true;
}
else
return false;
--------------------------------------
I was impressed by the amount of sheer ineptitude that the author of
the code had managed to squeeze into just a few lines.
# Why the blank line before "return true;"?
# Why are there braces around the if-part but not the else-part?
# The variable name, boolVal, is wonderfully uninformative.
# Why did the author write "(boolVal == true)" rather than just
"(boolVal)"?
# And, of course, why didn't the author replace the whole thing by
"return boolVal;"?
So far I have not been able to summon up enough courage to study the
rest of the program.