3 ms·
I'm aware of only two reasonable use cases for goto, both of which could be avoided with extra language features. Namely, breaking out of nested loops (which co
by aninhumer 10y ago
I'm aware of only two reasonable use cases for goto, both of which could be avoided with extra language features. Namely, breaking out of nested loops (which could be solved with optionally named loops) and error handling (which can be solved by some form of exception flow control).
Not that I think C should add these features, goto does these jobs okay, and there's enough stigma that it's unlikely to be used foolishly. But I think it's worth keeping in mind as we think about future languages.