Re:LLVM Programmer’s Manual
by barrkel on Friday July 22, 2016 @06:22AM
(#12142712)
Returning an error type, and, in the caller, propagating that return type further up, is isomorphic to exceptions, except it's a lot more busywork, a lot more code bloat, and a lot easier to get wrong.
[ Parent
| on HN ]
It's also encoded in the return type of the function, so you get static type checking -- a property not present for exceptions.
You say that like it's desirable. I think Java's experience of checked exceptions shows that it's of very dubious benefit.
Re:LLVM Programmer’s Manual
by perspectivep on Friday July 22, 2016 @10:31AM
(#12143720)
And you have to remember to log the error at every level of the stack, otherwise you're left with an error code that has no context.