Errors as values instead of some special language construct is generally a nice thing (IMO)
Exceptions are values. There's nothing different between:
T someFn() throws E;
fn someFn() -> Result<T, E>;
func someFn() (T, E)In only one of those examples do you get a T that's invalid.
True, Go does require you to follow a convention here (dont use T if err is not nil). In practice it works pretty well, though obviously not bullet proof.
I believe some exceptional languages are similar, like Ruby. If you rescue but dont abort, the variable on the left hand side gets a nil when that may otherwise not be possible. Of course, that is handled cleanly as its own error.
I don't see how. Unless it's the Go example where you get (nil, err)?