3 ms·
I like to think exceptions are also a slightly less egregious form of the GOTO.
by rubiquity 12y ago
I like to think exceptions are also a slightly less egregious form of the GOTO.
- jeorgun 12y agoMany things are — http://repository.readscheme.org/ftp/papers/ai-lab-pubs/AIM-443.pdf http://repository.readscheme.org/ftp/papers/ai-lab-pubs/AIM-...
- MetaCosm 12y agoI am a bit confused, what is the relevance of that paper to the comment? Unless I misunderstood, the comment appeared to be about flow control issues of exceptions(hidden control flow and corrupt state), and I don't see that addressed in that paper.
- rubiquity 12y agoThe paper is about subroutines (function calls) being a lot less complex because all a subroutine can do is finish and then go back to its caller. There are no semantics in subroutines for jumping around willy-nilly.
- Dylan16807 12y agoI don't really agree there. Exceptions can only break out. They're a moderately stronger form of return. You can't create spaghetti control flow with exceptions.
- MetaCosm 12y agoRead this: http://www.lighterra.com/papers/exceptionsharmful/ http://www.lighterra.com/papers/exceptionsharmful/ There is a reason exceptions are often banned from environments and it isn't because they are awesome. They make code "exceptionally" (zing) hard to reason about.
- Dylan16807 12y agoThey can be bad without being goto-like/unstructured. You can make a lot of the same arguments about break statements when it comes to skipping code and reaching a statement without being sure what the previous statement was or screwing up your loop.