2 ms·
I'm not sure if I agree with #5 and #8. For #5, more early returns means you don't have to keep track of as many paths as you go through the code. Granted you
by thdc 6y ago
I'm not sure if I agree with #5 and #8.
For #5, more early returns means you don't have to keep track of as many paths as you go through the code. Granted you could argue your function could warrant splitting up if you end up with too many returns.
#8 is dependent on whether or not it's safe to continue if one execution of the loop body fails (although he does say don't do it if you're going for that behavior, which I'd like to believe is the more common option)