4 ms·
Cool! I have an intuition that Rust and Haskell would be more compact than C#, Java and Go.
by kubb 5y ago
Cool! I have an intuition that Rust and Haskell would be more compact than C#, Java and Go.
- pjmlp 5y agoWhen using Java 16 and C# 9 the code can almost be Rust/Haskell like, even more in upcoming Java 17 and C# 10.
- kubb 5y agoI’m waiting on a blog post showing off the new features :)
- eatonphil 5y agoAny areas in particular you're thinking of in this code? I was trying to use as bleeding edge of features I could find.
- pjmlp 5y agoI was just speaking in general, haven't looked into detail into the code. For example, more pattern matching stuff is coming on both languages.
- kubb 5y agoApparently Java still won't have algebraic data types, which are very useful for this kind of code. It does have records, which are like kotlin data classes, a slightly more compact switch statement, and "pattern matching" which isn't actually pattern matching, it just allows you to omit a cast in an if branch if the if condition checks the type using instanceof.
- kubb 5y agoActually it's not completely true, in Java 17, the switch statement will be able to "match" a class name, and with sealed + permits and records you can have something like algebraic data types. Still, seems like no destructuring records, but maybe it's not strictly necessary.
- fishmaster 5y agoThat just sounds like a product type with some dynamic checking, no?