3 ms·
I don't think the addition of sum types broadly will be the panacea that people think. Software does need to be maintained, simpler things are easier to maintai
by gonzo41 6y ago
I don't think the addition of sum types broadly will be the panacea that people think. Software does need to be maintained, simpler things are easier to maintain.
- TazeTSchnitzel 6y agoSum types are simpler, and harder to misuse, than the common alternatives (unions or dynamic typing).
- mtzet 6y agoWhat simpler alternative is there? The OOP way would be to always hide data. This certainly has a different set of trade-offs, and sometimes requires the visitor pattern. Maintainable and simple are not words I would use to describe these cases. The other alternative is to emulate sum types through run-time type information or using code generation like protobuf. I also fail to see how these approaches are simpler or more maintainable. Sum types are not a panacea for all software development ills, but they're the simplest and most direct solution to a concrete problem: My data is either this type or that type.