3 ms·
How would Rust, Haskell or Kotlin be different? ;)
by pkolaczk 6y ago
How would Rust, Haskell or Kotlin be different? ;)
- oweiler 6y agoI think he means something like Java.
- pkolaczk 6y agoEven in Java, you can always use a switch based on enums or even int constants. The only thing missing would be exhaustiveness checking, but the other claims about extensibility or readability made in the article still hold.
- alboy 6y ago>The only thing missing would be exhaustiveness checking Not if you're on a recent version of Java, switch expressions are exhaustive and they're a stable (non-preview) feature now as of Java 14.
- echelon 6y agoIt's telling that sum types make a lot of code cleanliness issues disappear to the point we're reevaluating architectural vs performance considerations. Sum types rock.