3 ms·
I think the "errant advice" might originate with languages like C, in which an early return is an easy way to forget crucial deinitialization code, and where "g
by nneonneo 3y ago
I think the "errant advice" might originate with languages like C, in which an early return is an easy way to forget crucial deinitialization code, and where "goto"s can always be used to skip to the single exit point where all the deinitialization code is. In more sane languages, deinitialization happens automatically when leaving the stack frame, so following a "one return per function" rule is not necessary.