Exceptions vs Error Codes
Posted Mar 30, 2012 16:22 UTC (Fri) by
khim (subscriber, #9252)
In reply to:
Exceptions vs Error Codes by nybble41
Parent article:
Go version 1 released
So there are no "unsuspecting functions"; the only stack frames which an exception will unwind are those which declared that exception in the prototype.
That's why huge amount of Java code includes empty catch statements. And still RuntimeExceptions blow up programs regularly. I'm not sure if it's even possible to sanely use exceptions, but C#/Java exception handling is disaster.
In my experience exceptions are useless in most cases: sometimes you really want to compartmentalize your program, but fork(2) works fine in such cases. If your task is not large enough to use fork(2) then it's probably not large enough to warrant complex exception-based schemes.
(
Log in to post comments)