3 ms·
> yet I've managed to found "goto" statements (the "jump out of this function to some weird place in code" type) in the wild. I might just add that this is not
by raverbashing 7y ago
> yet I've managed to found "goto" statements (the "jump out of this function to some weird place in code" type) in the wild.
I might just add that this is not wrong and actually expected in some places. Linux uses it. It helps with some error handling situations.
But yeah with the other points I agree.
- golergka 7y agoWhile I've seen a few places where goto made sense (as in, "goto fail" in C), a goto that lead somewhere out of a function has never been one of them.
- xondono 7y agoThat’s what I’ve added the parens, I know there’s some very limited edge cases were it makes sense to tradeoff clarity for speed and use a goto. To clarify, I’m talking about stuff that could be easily done with functions or loops being done by random goto statements.
- uxp100 7y agoto further nitpick and distract from the main conversation, it sounds like they are talking about non-local goto (setjmp etc in c), which, just like an actual goto statement, is useful for error handling, but is much more difficult to deal with that a normal goto.