UPLOAD

    17K

    Future Of C#

    Published: May 30, 2018

    Microsoft - Future Of C#

    Comments

    Future Of C#

    • 1. Slide1231
    • 2. The Future of C# #MSBuild The Future of C# Mads Torgersen Dustin Campbell @MadsTorgersen, @dcampbell B8104
    • 3. Stack Overflow - most popular technologies Stack Overflow - most popular technologies stackoverflow.com/insights/survey/2017#most-popular-technologies
    • 4. Stack Overflow - most loved technologies Stack Overflow - most loved technologies stackoverflow.com/insights/survey/2017#most-loved-dreaded-and-wanted
    • 5. .NET Language Strategy .NET Language Strategy F# 10,000’s Tens of thousands VB 100,000’s Hundreds of thousands C# 1,000,000’s Millions
    • 6. C# C# F# 10,000’s Tens of thousands VB 100,000’s Hundreds of thousands C# 1,000,000’s Millions
    • 7. Visual Basic Visual Basic F# 10,000’s Tens of thousands VB 100,000’s Hundreds of thousands C# 1,000,000’s Millions
    • 8. F# F# F# 10,000’s Tens of thousands VB 100,000’s Hundreds of thousands C# 1,000,000’s Millions
    • 9. C#: The road ahead C#: The road ahead C# 7.0 It’s there – use it! C# 7.1 First point release – tiny features C# 7.2 Safe, efficient low-level code C# 7.3 Next steps for pattern matching? C# 8.0 Major features Demos! More demos!
    • 10. C# 8.0: Async streams and disposables C# 8.0: Async streams and disposables IAsyncEnumerable people = database.GetPeopleAsync(); foreach await (var p in people) { … } using await (IAsyncDisposable resource = await store.GetRecordAsync(…)) { … }
    • 11. C# 8.0: Extension everything C# 8.0: Extension everything extension Enrollee extends Person { // static field static Dictionary enrollees = new Dictionary(); // instance method public void Enroll(Professor supervisor) { enrollees[this] = supervisor; } // instance property public Professor Supervisor => enrollees.TryGetValue(this, out var supervisor) ? supervisor : null; // static property public static ICollection Students => enrollees.Keys; // instance constructor public Person(string name, Professor supervisor) : this(name) { this.Enroll(supervisor); } }
    • 12. C# 8.0: Records C# 8.0: Records class Person : IEquatable { public string First { get; } public string Last { get; } public Person(string First, string Last) => (this.First, this.Last) = (First, Last); public void Deconstruct(out string First, out string Last) => (First, Last) = (this.First, this.Last); public bool Equals(Person other) => other != null && First == other.First && Last == other.Last; public override bool Equals(object obj) => obj is Person other ? Equals(other) : false; public override int GetHashCode() => GreatHashFunction(First, Last); … } class Person(string First, string Last);
    • 13. Resources Resources Language strategy blogs.msdn.microsoft.com/dotnet/2017/02/01/the-net-language-strategy/ blogs.msdn.microsoft.com/vbteam/2017/02/01/digging-deeper-into-the-visual-basic-language-strategy/ C# design github.com/dotnet/csharplang blogs.msdn.microsoft.com/dotnet/2017/03/09/new-features-in-c-7-0/ Roslyn github.com/dotnet/roslyn
    • 14. Where to find us Where to find us At the “C#, Visual Basic and F#” booth @roslyn @dcampbell @MadsTorgersen
    • 15. Slide1292 © Copyright Microsoft Corporation. All rights reserved.