3 ms·
goto is better than exceptions because goto is scoped.
by Gibbon1 4y ago
goto is better than exceptions because goto is scoped.
- kaba0 4y agoThey are orthogonal features. Also, exceptions are not long jumps either, they have well-defined semantics of only traveling through the call stack.
- preseinger 4y agogoto is generally _unscoped_, the languages in which it is scoped are exceptions. Right? goto in C is unscoped, afaik?
- Gibbon1 4y agoIn C goto is scoped. void Foo(int x) { if(x == 10) goto goof; // don't work. } void Baz(void) { goof: printf("goof isn't in scope"); }
- preseinger 4y agoTIL