I don’t understand why it is a best practice to use positive logic in an if block
http://msdn.microsoft.com/en-US/library/aa629483.aspx
Preferred:
if (true)
{
...
}
else
{
...
}
Why it is a best practice to have positive logic in an if block?
It’s generally regarded as easier to understand.
vs.
Your logic may be crystal-clear to you today, but think of the developer who happens across it a couple of years from now.
But like everything else, this is only a guideline. Specifically, I use something like “negative logic” with error checking:
I avoid a cascade of conditionals that “positive logic” would otherwise require.