3 ms·
Reading and debugging code filled with gotos can be a real nightmare.
by Mizoguchi 4y ago
Reading and debugging code filled with gotos can be a real nightmare.
- Sohcahtoa82 4y agoLater dialects of BASIC had code blocks and functions, making GOTO unnecessary. If you were using GOTO in your BASIC code in the 90s, you were doing it wrong.
- skeeter2020 4y agoOK, then what about "On Error Resume Next"? ;)
- ipaddr 4y agotry / catch replaces that today
- Sohcahtoa82 4y agotry / catch is almost he opposite of On Error Resume Next OERN would make it so uncaught errors were silently ignored and execution would just continue on the next line as if nothing wrong happened. This would likely result in more errors, which would then also be ignored.
- ptx 4y agoFrustratingly, the "on error goto" mechanism in Visual Basic is basically try/catch, except that the error object doesn't give you any kind of stack trace (not even the procedure or line number where the error occurred) so you have to constantly catch and rethrow errors just to add context information.
- Sohcahtoa82 4y agoThe absolute smelliest of code smells.
- pcdoodle 4y agoChad move. Something broke but we still moving to the next line.