Re: goto considered essential
- Posted by Tom Dailey <thomasdailey at comcast.net> Jan 21, 2006
- 523 views
Jason: Thank you for your detailed reply. You characterize errors as falling into two categories, at least in the context of this discussion. But I submit that there is a third category, at least from the viewpoint of a function that detects an error. In this category are errors that are to be handled by the caller. The function itself neither panics nor performs recovery, but simply reports the error to the caller. It is this class of errors that concern me most here, insofar as code clarity is concerned. For such situations, gotos (or something like them) are really the only answer -- unless one defines a full-blown nonlocal goto semantics, like Java or Ada exceptions, or PL/I on-units. Tom