3 ms·
That's a fine use of goto and not in any way bad design in my opinion. It makes it very clear that it's _REQUIRED_ to run the cleanup stuff regardless of the s
by dusted 5y ago
That's a fine use of goto and not in any way bad design in my opinion.
It makes it very clear that it's _REQUIRED_ to run the cleanup stuff regardless of the skipped block.
It does so without wrapping the entire skipped block in an IF (which also has two side effects: of causing more indentation and making the cleanup stuf look less required, or incidental).
It does so without adding another tiny silly, only-_REALLY_-used-on-place function for cleaning up, which decreases readability and causes more code duplication since there is then a need for not one, but two function calls and/or multiple return paths where not needed.