Re:If-then-else had to be invented
by wodenokoto on Thursday December 17, 2020 @11:04AM
(#25456791)
Thank you for the thoughtful answer.
It made me rethink the premise of my question.
It made me rethink the premise of my question.
It is true that you can always just use if statements, it's more about the convenience and cleaner syntax. You can also do destructuring with pattern matching. Pattern matching is almost a requirement if you are going to use algebraic data types.
As Paul Graham says in Beating the Averages, you have to look at the other language from the perspective of knowing it. Nobody can really explain it. It's just going to seem equivalent or weird syntax otherwise.