2 ms·
They’re not direct support, but option types only work in languages with the right syntax and tooling to make them work. C union types, for example, aren’t real
by SpicyLemonZest 8y ago
They’re not direct support, but option types only work in languages with the right syntax and tooling to make them work. C union types, for example, aren’t really capable of providing a null replacement simply because they’re so complex to use.
- HumanDrivenDev 8y agoThey’re not direct support, but option types only work in languages with the right syntax and tooling to make them work. I strongly disagree. You don't need pattern matching syntax to use option types effectively. All you need are the right methods - map, flatMap, getOrElse etc etc. Any language with inheritance and dynamic dispatch can implement a good option type. Even in languages with pattern matching, I never reach for it when dealing with options.