Take for example the following two statements:
if (booleanVariable)
{
doSomething();
return true;
}
else
{
return false;
}
and
if (booleanVariable)
{
doSomething();
return true;
}
return false;
Which one would be preferred?
They both return the same result in the end.
Any reason one would be better to use than the other?