6 ms·
What's new in C# 8
- SideburnsOfDoom 8y ago> Async streams, indexers and ranges all rely on new framework types that will be part of .NET Standard 2.1. ... .NET Core 3.0 as well as Xamarin, Unity and Mono will all implement .NET Standard 2.1, but .NET Framework 4.8 will not. This means that the types required to use these features won’t be available when you target C# 8.0 to .NET Framework 4.8. We are approaching the point where .NET full framework becomes legacy, deprecated by .NET Core. NetStandard 2.1 things like Span<T> are already in NETCore 2.1 now, but won't be in the next release of fullFramework, .NET Framework 4.8. Which .NET Framework will they arrive in, and when, if ever? That question has not been answered, even with an approximation or roadmap.
- deleted 8y ago[deleted]
- merb 8y agowell to be fair, I would've prefered that they would kill mono...
- polskibus 8y agoThis is so bad - the language should be independent from the platform. They are breaking a lot of stability that was on the platform before, infuriating users and making people move away from .NET altogether. This is how you lose developers trust - who will trust them not to drop .NET Core soon in the future and start reimplementing again?
- marsrover 8y agoSo excited for nullable reference types.
- SideburnsOfDoom 8y agoTrue, but I'm not excited for trying to apply it to enormous piles of existing code; or conversely, writing them off as "legacy".
- gregmac 8y agoThere's actually several features here that could radically change the way I structure certain types of code -- notably async streams and default implementations, in addition to nullable reference types -- and it will be hard not too look at the older methods as legacy. These changes will have a comparable effect to what LINQ, generics, lambdas and async/await all did, and when you look at code that was created prior to those features it definitely looks 'legacy' today.
- SideburnsOfDoom 8y ago> - and it will be hard not too look at the older methods as legacy. You're right, it will be legacy. And the job is to support the business, and that means maintaining, fixing, extending the existing code. The legacy code. It's going to be a long time until the bulk of it is up to date with all of this.
- twoquestions 8y agovar area = figure switch { Line _ => 0, Rectangle r => r.Width * r.Height, Circle c => c.Radius * 2.0 * Math.PI, _ => throw new UnknownFigureException(figure) }; So more and more of F# is making it's way to C#. Between this and better tuple literals, I'm very happy about this! (I still need to get around to learning F# for real though, I really love it's brevity.)
- neilsimp1 8y agoI'm looking at this as well. I'm confused about the word `figure` here. It looks like it's a keyword for this new type of pattern matching switch. but the word `figure` itself seems unneeded.
- chusk3 8y ago`figure` here is just an instance of Shape that was previously in scope. You've got to match on an instance of an object in this syntax.
- contextfree 8y agoIt looks like "switch" is an infix operator in this context, so "figure" is just the variable/value on which the match operates.
- GordonS 8y agoI often find that my switch cases as one-liners, so this looks great!