Hacker News new | ask | show | jobs
by m_sahaf 2869 days ago
The pattern is the programmer's choice. Here's a contrary example/approach:

https://blog.golang.org/errors-are-values

1 comments

Claiming "errors are values" is as useless as claiming anything in computing is "a value" (because it is).

Errors are not just values, however, they're something much more specific: An uncaught error is a specific circumstance where the programmer's mental model was insufficient to account for all the state possibilities. Literally the introduction of the unexpected. And this should be treated as a very bad (or at least a very special) thing, as soon as possible. Hence, runtime exceptions. (Hence, disclaimer alert, I'm not a fan of Go.)