3 ms·
I bunch of stuff was added in the recent years. Just a few examples: Pattern Matching https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-8#more-
by JaggerJo 4y ago
I bunch of stuff was added in the recent years. Just a few examples:
Pattern Matching
https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-8#more-patterns-in-more-places https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/cs...
Non destructive mutation
https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-9#nondestructive-mutation https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/cs...
Null-coalescing assignment
https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-8#null-coalescing-assignment https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/cs...
- rattray 4y ago(your last link should have been https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-8#null-coalescing-assignment https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/cs...) I don't work in C#, but I must say, these seem like great features to me, and not too crufty/bloaty at all. Scrolling through the other recent feature additions, they all look like things that would make a language feel smoother rather than more noisy. But again, IANAC#D.
- JaggerJo 4y agoMight be just me, but in larger teams it's annoying because not everyone knows the most recent features. I wrote C# daily before I switched to F# ~3 years ago and I sometimes struggle reading "modern" C# code. In C# you now often have multiple ways of doing the same thing.
- wizofaus 4y agoPattern Matching was 5 years ago (and I use it all the time, it's great). I have to admit I've not come across many C# 9.0 features in the wild yet, and I might double take if I saw them used liberally throughout a codebase. The null-coalescing assignment I'm a bit skeptical about the value of, or at least, it doesn't fit with my preferred style of coding (sticking to non-nullable types where possible, and generally avoiding variable reassignment).