What's New in C# 8.0
Video Statistics and Information
Channel: Microsoft Visual Studio
Views: 289,047
Rating: 4.925693 out of 5
Keywords: C#, .NET, Visual Studio
Id: VdC0aoa7ung
Channel Id: undefined
Length: 12min 56sec (776 seconds)
Published: Tue Dec 04 2018
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.
My jaw is still on the ground. So many good features in there.
I could have used case expressions countless times over the last 22 years
So excited for these features! c# has come a long way!
At 8:25, Mads uses range syntax
^1
to indicate "1 from the end". The last time I read about this feature, the indexes were 1 indexed when referring to the end of the array. So,1..^1
would actually only omit the first element, and not one from each side.Was this feature changed, or was Mads mistaken?
Edit: After looking into it a bit, it seems this feature was changed. At BUILD this year, they used
^1
to refer to the last element, but in this MSDN doc (published yesterday), they use^0
.Im quite new to C# and these concepts. Can anyone offer some different practical uses for this new syntax? Edit: a word
I'm glad C# is improving in big ways, and relatively quickly compared to other popular languages, especially Java, but I can't help but take issue with some of these features. Get your downvotes ready, lads.
Non-nullable references seem half-assed to the point that they're barely better than using ReSharper and sprinkling
[CanBeNull]
and[NotNull]
attributes everywhere. I get the reasoning that they don't want to break existing code on an upgrade, but then why is it still a warning even after opting-in to these new semantics? It should be a compiler error without additionally having to tell the compiler to treat that specific warning as an error. It's like they said "fine, you can have your fancy non-nullable references, but you have to opt-in twice to get there".I also really hate default interface implementations. It's redundant with abstract classes and adds pseudo multiple inheritance (which I also hate) which I have to assume was excluded from C# by deliberate design choice when the language came to be. And the reason given about forward compatibility when an interface changes all existing implementations don't necessarily have to change, combined with the double opt-in of non-nullable references makes it sound like Microsoft is going the C++ route of "never ever ever ever break compatibility ever, even when it makes sense for the long-term", and I don't think I need to explain why that's not a good thing.
Also records weren't mentioned in the video, have they been pushed back again, or is this just an incomplete list?
I find default interface members to be highly questionable.