The Evolution of Pattern Matching in C#
I came across an excellent summary of how C# pattern matching has improved over time: “Your Quick Guide to Pattern Matching in C#” by Aram Tchekrekjian. In short, pattern matching has evolved to be very convenient and flexible!
Once C# gets discrimated unions (DUs)—which, incidentally, F# already has—I believe we’ll also have exhaustive pattern matching. That and DUs themselves stand to be intriguing additions to the language. It’s still very unclear when DUs will be added, but I’m looking forward to it.