4 ms·
What are these guarantees? One is that they are easier to miss when reading the code.
by andi999 4y ago
What are these guarantees? One is that they are easier to miss when reading the code.
- ketzu 4y agoSorry, I don't fully understand what you mean by that. Are "early returns" easier to miss when reading code (easier to miss than goto statements achieving the same effect)? If that was your intended meaning (sorry I am missing some sleep today) I don't share that view, I think both statements are equally obvious in that regard. Examples I was thinking about: * an early return can only go back to the call-site * all returns in a function or method return to the same place * an early return terminates the context it is in * an early return does not create an entry point for nearly arbitrary other code points as labels for gotos do