I am tagging this as C, though it certainly applies to many languages. The reason for this is the part of the question dealing with optimization, which is compiler dependent.
Sometimes we encounter situations like this in programs:
if(bob == 42)
{
/* ... */
return;
}
else
{
/* ... */
}
The else block here is not strictly necessary, as you can probably see. The same thing also occurs with other program-flow-controlling structures; some “ordinary” constructs are made redundant because of special conditions. The question is: Is there a reason to write these redundant blocks of code? Clarity? Could it possibly help a compiler with optimizations, if the situation was complex enough?
I refer to what you’ve written as “self-documenting code”. By using the else block, you make it easier for people to see that if bob does not equal 42 the 2nd block of code will fire.
In my computer science classes, we would be given code samples like this to test our logical skills. But in the business world, you really don’t want to confuse people or do anything that could slow down progress. Therefore, you should opt for whatever is easiest to read assuming the performance hit is negligible.
Self-documenting code means that the explanation of what is going on can be seen in the function names or by reading the actual code, reducing the need for code comments.
As far as running the code goes, do some tests with some timing code to see what performs better.