Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As predicted you decided that since it matters, not having a reference is "invalid". But it wasn't invalid, like I said, maybe you don't have a reference. Only maybe. Either way is valid in this system. The user needs to care which is which.

In the languages you prefer (such as C), we can't distinguish this case from the case where we should always have a reference and not having one is a bug, they look the same, the machine can't help us get this right and hopefully the user carefully consults our documentation "NB this value may be NULL". Ugh.

Go is a wonderful example of a language that's grossly unsuited to this problem. Instead of "Make invalid states unrepresentable" Go chooses "Make representable states valid". Don't want a default for this type? Too bad, Go insists zero is valid and that's always your default, feel free to name this "DoNotUse_GoIsAWful" if you like, in a large system it'll get used anyway.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: