Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Go and Simplicity Debt Redux. Parent comment
If you have a type for Some | None, then the return type of maps/chans/etc of (T, bool) aren't needed.
Similarly, the (T, err) returns can be replaced by a T | error sum type.
Sometimes multiple returns are used in other cases, but returning a struct covers those, or proper tuples where the value you return is a tuple.
I'm just claiming that multiple return is 90% of the time being used to patch over the lack of proper optional or either types.
There are no comments on this comment yet.
If you have a type for Some | None, then the return type of maps/chans/etc of (T, bool) aren't needed.
Similarly, the (T, err) returns can be replaced by a T | error sum type.
Sometimes multiple returns are used in other cases, but returning a struct covers those, or proper tuples where the value you return is a tuple.
I'm just claiming that multiple return is 90% of the time being used to patch over the lack of proper optional or either types.