4 ms·
Even in Kernel programming, exceptions are useful. If you read http://www.kernel.org/pub/linux/docs/lkml/#s15-5 http://www.kernel.org/pub/linux/docs/lkml/#s15-5
by sreque 17y ago
Even in Kernel programming, exceptions are useful. If you read http://www.kernel.org/pub/linux/docs/lkml/#s15-5 http://www.kernel.org/pub/linux/docs/lkml/#s15-5, you'll see that goto's are used to reduce code duplication for error handling, which is essentially just a poor man's exception. More sophisticated exception handling in C can and has been done with longjmp as well.
- deleted 17y ago[deleted]
- uriel 17y agoGo has goto. Unlike goto as used in the linux kernel, exceptions will jump up the call stack god knows where. And in essence exceptions are not goto, but camefrom.
- barrkel 17y agoExceptions jump to the declared handler - i.e. the right place. I remain convinced that far too many people have gotten wrong ideas about exceptions from the bastardized implementations in C++ and Java.