Remix.run Logo
SkiFire13 4 days ago

> had it since version 1. Now, 15 versions later, C# has acquired all the modern features from all paradigms of programming, including [...] an incredibly full-featured pattern matching system. Java is laughably lagging behind.

Did C# finally implement some kind of discriminated unions with exhaustive pattern matching? Last time I checked not even plain `enum`s supported exhaustive pattern matching. For comparison, even Java supports discriminated unions in the shape of sealed classes/interfaces with exhaustive pattern matching since Java 21

stonemetal12 4 days ago | parent [-]

Sort of. They are a part of C#14 and .net10. Which officially releases in Nov, but has been out as preview for a while now.

SkiFire13 4 days ago | parent [-]

Maybe I'm missing something, but it doesn't look like C# 14 will include them nor release in November https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/cs...

valiant55 4 days ago | parent [-]

They might make it into v15 next year according to the latest presentation from Mads. They have the design hammered out just needs to be implemented. It sounds like it should be in an early preview version to let the other teams start to build features asap.