Re:Errors are values
by millstone on Tuesday January 13, 2015 @01:55AM
(#8878513)
I don't get it. How is "errors are values" different from anything? In what language are errors not values?
[ Parent
| on HN ]
In languages where they are exceptions and are not returned, but thrown and require special syntax to handle.
But exceptions are values too, i.e. you routinely have an object of type IOException. All of the patterns presented in the article can be done easily with exceptions.
I think maybe "errors are values" is a general principle and not meant to be specific to Go.
Re:Errors are values
by alecbenzer on Tuesday January 13, 2015 @06:29PM
(#8883300)
Exceptions are values too but they're more than values. "Errors are values" means "errors are values so just deal with them like you do other values".