3 ms·
Pattern matching + switch expressions can make for really concise and functional state machines which can be validated for coverage at compile time.
by bob1029 6y ago
Pattern matching + switch expressions can make for really concise and functional state machines which can be validated for coverage at compile time.
- mycall 6y agoI would love to see this in action. Do you know of any repos that are doing this?
- ducharmdev 6y agoIf you have the time, there's this great talk by Bill Wagner that goes over some of these newer features. You can also skip right to the pattern-matching section; he shows a good example of how powerful switch expressions can be. https://m.youtube.com/watch?v=aUbXGs7YTGo https://m.youtube.com/watch?v=aUbXGs7YTGo Alternatively, this page on the C# 8 release has good examples too. They show how you can leverage tuples to make them even more powerful. https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-8#more-patterns-in-more-places https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csh...