3 ms·
> F# has sum types, and replaces null with an option type - great ideas, but you can approximate these ideas in any language if you need to. How? You can make
by seanwilson 9y ago
> F# has sum types, and replaces null with an option type - great ideas, but you can approximate these ideas in any language if you need to.
How? You can make up for it somewhat with linters, unit tests etc. but it's tiring and nowhere near as robust as a type checker that enforces null checks for you.
- gameswithgo 9y agooh I agree, and understand. You lose compile time enforced type safety against nulls when you approximate it, and I do think it is the right approach to use option types instead of null, and that more languages should do this. But it is just one parameter of a thousand affecting how easy it is to write good code, it sometimes has runtime costs.