Hey I just came across an function and I was confused as which one is better?
private static bool IsEqual(TypeABC output, TypeABC input)
{
if( conditions....)
{
return true;
}
return false;
}
or
private static bool IsEqual(TypeABC output, TypeABC input)
{
bool isEqual = false;
if( conditions....)
{
isEqual = true;
}
return isEqual;
}
Both perform the same thing but
I want to know from from any perspective may it be coding standards, performance or garbage collection. Which one of the above is better and why?
Or if its too generic to answer, then advantages / disadvantages of each code over the other.
Also suggest a few tags I should put for this question.