if
statements should be avoided CS-W1077If statements allow you to execute code depending on whether the specified condition evaluates to true
or false
. An empty if
statement has no statements in both of its branches and effectively accomplishes nothing. Such statements should be avoided.
if (numbers.Any(x => x % 2 == 0)) ;
if (numbers.Any(x => x % 2 == 0))
{
// ...
}
else
{
// ...
}