3 ms·
Error handling.
by dom0 9y ago
Error handling.
- johannes1234321 9y agoIn most languages there are better way to do this than goto. Among them - extracting code into smaller functions (yes, state has to passed around) - exceptions (yeah yeah, hate them or love them, but if used in your environment it makes sense not to avoid them) - RAII pattern or handling cleanup, which allows simple return and "automatic" resource handling - etc. True, in a language like C these don't apply necessarily and goto still has some use -
- vortico 9y agoParsers (or more generally state machines) and error handling are the two places I've seen that are acceptable. We've managed to complete the list. :)