logoalt Hacker News

umanwizardlast Tuesday at 5:17 PM2 repliesview on HN

Go can’t have Result because they don’t have sum types, and they can’t add them because of their bizarre insistence that every type has to have a designated zero value.


Replies

masklinnlast Tuesday at 5:32 PM

> they can’t add them because of their bizarre insistence that every type has to have a designated zero value.

Nothing prevents adding union types with a zero value. Sure it sucks, but so do universal zero values in pretty much every other situation so that's not really a change.

show 1 reply
stousetlast Wednesday at 7:52 AM

> every type has to have a designated zero value

This bonkers design decision is, as far as I can tell, the underlying infectious cause of nearly every real issue with the language.