PPT Slide
- As you can see, it gets convoluted very fast even for such a simple sequence of steps.
- Historically, the way programmers got around this was simply to not do any error handling at all!
- Instead, they generally used one of two approaches:
- Upon detecting an error, simply terminate the program, i.e., “recognizethe error but don’t handle it, just quit”, or else …
- Don’t even attempt to detect the error; i.e., “let the program react in anarbitrary and unpredictable manner”(blow up? bad values? wrong behavior?)
- Both of these violate a basic tenet of structured
programming: “Allow only a single point of exit from
any procedure or function.”
Exceptions: Traditional Approaches