logoalt Hacker News

9rxlast Wednesday at 3:17 PM1 replyview on HN

But, of course, makes the incorrect assumption that <T, E> are dependent variables. The idiomatic Go approach is much more representative of reality. Tradeoffs, as always.


Replies

masklinnlast Thursday at 5:24 AM

You have things the wrong way around.

A developer uses Result because T and E are exclusive. If they’re not, they will use something else. And it will be clear to the caller that they are in a rare oddball case.

The idiomatic Go approach makes no provision for such distinctions at all.

show 1 reply