Re:Errors are values
by lectrick on Tuesday January 13, 2015 @12:44AM
(#8878358)
Saying it's so doesn't make it true. You can declare that an error is simply a special value returned and expect people to check for that value all over the place, or you can declare that errors are (literally) "exceptions" and should therefore throw.
[ Parent
| on HN ]
You can ignore error values returned just like you can ignore the numeric value returned from atoi. That's the point. They're just values. You are the programmer, it's your job to decide what to do with any particular value returned by a function.
Re:Errors are values
by prodigal_erik on Tuesday January 13, 2015 @12:20PM
(#8881154)
It's also my job to decide what the square root of "fish" should be. What I do is use a declaration to mechanically verify that cannot ever happen. I never ever want to silently ignore an error, so why shouldn't I be able to declare that as well?