3 ms·
What's New in C# 11
- jayhoon 4y agoThe disclaimer on the page says that the features are in preview, although Microsoft announced that C# 11 is out as in final: https://devblogs.microsoft.com/dotnet/welcome-to-csharp-11/ https://devblogs.microsoft.com/dotnet/welcome-to-csharp-11/
- gorokan 4y agoA 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.
- superchroma 4y agoI'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.
- jayhoon 4y agoC# 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.