I am following some examples in the book, and I noticed two different conventions for having various return conditions. Is there any difference between the two?
//example 1
if(someCondition)
{
return (someValue);
}
return (someOtherValue);
//example 2
if(someCondition)
{
return (someValue);
}
else
{
return (someOtherValue);
}
Personally, I like the second example better, because it's more explicit, and I feel that it's more readable.