2 ms·
Mentally folding sections of code is easier with multiple returns- the code that satisfies the conditions established by the early return is just the rest of th
by Rusky 15y ago
Mentally folding sections of code is easier with multiple returns- the code that satisfies the conditions established by the early return is just the rest of the function, rather than until the denesting point you have to look for.
RAII, GC, and/or try/finally solve the "error-proneness" of early returns, and in a language like C you can simulate that with a simple (good use of) goto.