It was pretty sketchy when exceptions were first introduced to programming languages. They've been around in some form or another in languages dating back to the seventies. Smalltalk is likely the oldest language with exception handling abilities. Similarly-aged C includes an ability to signal that could be used for general exception communications, but it is intended more to provide interrupts. C also includes the ability to "long jump", but this is mostly provided within the library rather than in the language, that is, there is a setjmp
method to define a destination (for example a handler) and a longjmp
method to "throw." But setjmp/longjmp
is no more than a "non-local goto"—there's no decoupling of the handler from the thrower. It's very complex and error-prone to use setjmp/longjmp
for exception handling. So complex that the intent of the methods using it can easily get lost.
Smalltalk effectively includes syntax for throwing and handling exceptions. Smalltalk...