Now you can easily write the following state machine in C#: static State ChangeState(State current, Transition transition, bool hasKey) => (current, transition) switch { (Opened, Close) => Closed, (Closed, Open) => Opened, (Closed, Lock) when hasKey => Locked, (Locked, Unlock) when hasKey => Closed, _ => throw new InvalidOperationException($"Invalid transition") };
.NET Core 3.0
11–20 of 183 posts
Re: .NET Core 3.0
#12> Nullable enables you to directly target the flaws in code that lead to NullReferenceException. The lowest layer of the framework libraries has been annotated, so that you know when to expect null. I hope Java gets this one day.. would be a cool feature
Optional ? But redoing the standard lib would be no go in javaland ? It's the non nullable reference I find interesting.
MS does this sort of thing a good amount, preserving backwards compatibility but enhancing the experience.
Re: .NET Core 3.0
#13https://devblogs.microsoft.com/dotnet/performance-improvemen...
How could a mature standard library / frameworks have so much performance gains to be had?
Re: .NET Core 3.0
#14Re: .NET Core 3.0
#15List of performance improvements is mind-boggling: https://devblogs.microsoft.com/dotnet/performance-improvemen... How could a mature standard library / frameworks have so much performance gains to be had?
Re: .NET Core 3.0
#16What's crazy is that this is what C# should have always been. I was into Mono way back because I thought niavely it was going to be more successful, but I think if C# had gone this route earlier -> the whole python / go etc popularity boom might have been softer and MS would have had a first class player that would have increase # of folks easily able to build in windows. That and I never got to develop successfully…
I’ve thought about this but I doubt it. The big change has been the perception shift. .NET was always really solid tech. Microsoft has always had stellar developer technology. But the love affair with open source and the super villain role that Microsoft played, is what kept people away, not the tech itself. I remember wanting to give a talk about how amazing C# was to a ruby group. I never did it, but it was definit…
Re: .NET Core 3.0
#17Now you can easily write the following state machine in C#: static State ChangeState(State current, Transition transition, bool hasKey) => (current, transition) switch { (Opened, Close) => Closed, (Closed, Open) => Opened, (Closed, Lock) when hasKey => Locked, (Locked, Unlock) when hasKey => Closed, _ => throw new InvalidOperationException($"Invalid transition") };
Re: .NET Core 3.0
#18List of performance improvements is mind-boggling: https://devblogs.microsoft.com/dotnet/performance-improvemen... How could a mature standard library / frameworks have so much performance gains to be had?
But now that .NET runs everywhere, it has to compete with projects that have been shipping performance improvements all along. Happily, since it's now open-source too, it can accept those changes from anyone.
Re: .NET Core 3.0
#19Now you can easily write the following state machine in C#: static State ChangeState(State current, Transition transition, bool hasKey) => (current, transition) switch { (Opened, Close) => Closed, (Closed, Open) => Opened, (Closed, Lock) when hasKey => Locked, (Locked, Unlock) when hasKey => Closed, _ => throw new InvalidOperationException($"Invalid transition") };
Still no exhaustiveness checking like a true match expression unfortunately, which is what would give it parity against the traditional subclass/polymorphic approach.
Re: .NET Core 3.0
#20What's crazy is that this is what C# should have always been. I was into Mono way back because I thought niavely it was going to be more successful, but I think if C# had gone this route earlier -> the whole python / go etc popularity boom might have been softer and MS would have had a first class player that would have increase # of folks easily able to build in windows. That and I never got to develop successfully…
I’ve thought about this but I doubt it. The big change has been the perception shift. .NET was always really solid tech. Microsoft has always had stellar developer technology. But the love affair with open source and the super villain role that Microsoft played, is what kept people away, not the tech itself. I remember wanting to give a talk about how amazing C# was to a ruby group. I never did it, but it was definit…