3 ms·
Ive thought a bit about this, and how is Option types (which I like and prefer to error checking) really different from the compiler emitting an error when you
by makapuf 7y ago
Ive thought a bit about this, and how is Option types (which I like and prefer to error checking) really different from the compiler emitting an error when you fail to explicitely check for nulls and stdlib returning nulls when you have one ?
- quelltext 7y agoBecause it forces (or at least strongly encourages) you/users of such a stdlib/API to explicitly think about and handle the null case and the non-null case if you want to access the contents directly / unwrap. At least that's the idea.
- pasquinelli 7y agoThat is what it is, a branch at the type level that the type checker mandates you complete both sides of.
- bedobi 7y agoI think it's better, see the other reply at https://news.ycombinator.com/reply?id=22306638&goto=threads%3Fid%3Dbedobi%2322306638 https://news.ycombinator.com/reply?id=22306638&goto=threads%...
- deleted 7y ago[deleted]