Hacker News new | ask | show | jobs
by jarfil 4209 days ago
GOTO statements are not bad, they make your code run 10% faster while taking just 10 times as long to debug.

So if your code gets executed millions of times per second, like in some OS kernel, it may be wise to use GOTOs.

Otherwise, stay away.

1 comments

Gotos are nowhere near as hard to debug as exceptions.
How's that? To debug GOTOs you have to place breakpoints on each possible detection of error (or at a shared trampoline). To debug exceptions, you just enable first-chance exception handling for the kind of exception you're interested in and you're done.