What's New in C# 11(learn.microsoft.com)
learn.microsoft.com
What's New in C# 11
https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11
4 comments
A friend of mine who has been using C# for 15 years now, often complains that he cannot recognise the language anymore. I think the breaking point for him was C# 7.
I've felt that way at one point, but it is on you as to how far you want to push it. If you want to do C# like it's 2008, it won't stop you.
As for me, I take the good bits that I like and ignore the rest now. I resent only two changes. Firstly, eliminating null values for classes was a mistake, and you're trading one class of error (null data) for another (placeholder/default data). There's no plus as far as I can tell. Apps with the second error scenario are in an unknown state and that's not something you want lasting for too long. The second change I dislike is that the inverse indexing syntax starts from 1 instead of 0 to access the last item. That's idiotic.
As for me, I take the good bits that I like and ignore the rest now. I resent only two changes. Firstly, eliminating null values for classes was a mistake, and you're trading one class of error (null data) for another (placeholder/default data). There's no plus as far as I can tell. Apps with the second error scenario are in an unknown state and that's not something you want lasting for too long. The second change I dislike is that the inverse indexing syntax starts from 1 instead of 0 to access the last item. That's idiotic.
C# 11 addresses the first issue by adding the required fields/properties: such members must have their values set upon instantiation.
For the second one, the ^1 index stands for length-1, which is the last element's index. With ^0 the compiler should implicitly add 1 every time an index is accessed.
For the second one, the ^1 index stands for length-1, which is the last element's index. With ^0 the compiler should implicitly add 1 every time an index is accessed.
https://devblogs.microsoft.com/dotnet/welcome-to-csharp-11/