Re:Source code of the file with the Zune bug (starts on line...
by thwarted on Thursday January 01, 2009 @11:20PM
(#417026)
That may be hard to do if it's cleanup code, as the scope changes. Plus, it divorces, visually, the cleanup code from the main body. And there may be additional function call overhead (which may be avoidable by having the compiler in-line it). One reason to use goto is the style that all functions should have one entry and one exit. Even if the cleanup code was put into its own function, you'd still have to ensure that the function was called in all the right places before returning. Without gotos, the logic can become harder to follow through a series of if-else blocks.
Isn't that the definition of "when to extract code into its own function"?