I know you know this, but it's worth mentioning another big advantage of local over the hand-coded equivalents exampled by your respondee.
The programmer (or another at some later time) may modify the code such that it returns without restoring the original value.
With local, this won't happen. The programmer might forget, but the compiler/interpreter will not.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.
| [reply] |