Re:Why your F# evangelism isn't working
by tigershark on Wednesday May 31, 2023 @03:39AM
(#36135587)
This tells me that you never really looked at functional languages, not even used them.
The power of ADT, especially when using a comprehensive pattern matching expression, is pretty difficult to emulate in the OOP world without a ton of code.
But in this extremely simple case you just need a record.
The advantage is that it’s immutable and it’s guaranteed to don’t have null in any fields.
C# only introduced records recently, while F# was born with them.
And C# still hasn’t got ADT because it’s missing the Union types as far as I remember.
[ Parent
| on HN ]
There are no comments on this comment yet.