5/19/2018 1:01 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
The Future of C# Mads Torgersen Dustin Campbell @MadsTorgersen, @dcampbell © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Stack Overflow - most popular technologies stackoverflow.com/insights/survey/2017#most-popular-technologies
Stack Overflow - most loved technologies stackoverflow.com/insights/survey/2017#most-loved-dreaded-and-wanted
.NET Language Strategy 1,000,000’s 100,000’s 10,000’s C# VB F# 5/19/2018 1:01 AM .NET Language Strategy C# 1,000,000’s Millions VB 100,000’s Hundreds of thousands F# 10,000’s Tens of thousands © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
C# 1,000,000’s 100,000’s 10,000’s C# VB F# Millions 5/19/2018 1:01 AM C# C# 1,000,000’s Millions VB 100,000’s Hundreds of thousands F# 10,000’s Tens of thousands © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Visual Basic 1,000,000’s 100,000’s 10,000’s C# VB F# Millions 5/19/2018 1:01 AM Visual Basic C# 1,000,000’s Millions VB 100,000’s Hundreds of thousands F# 10,000’s Tens of thousands © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
F# 1,000,000’s 100,000’s 10,000’s C# VB F# Millions 5/19/2018 1:01 AM F# C# 1,000,000’s Millions VB 100,000’s Hundreds of thousands F# 10,000’s Tens of thousands © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Demos! More demos! C#: The road ahead C# 7.0 C# 7.1 C# 7.2 C# 7.3 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!
C# 8.0: Async streams and disposables IAsyncEnumerable<Person> people = database.GetPeopleAsync(); foreach await (var p in people) { … } using await (IAsyncDisposable resource = await store.GetRecordAsync(…)) { … }
C# 8.0: Extension everything extension Enrollee extends Person { // static field static Dictionary<Person, Professor> enrollees = new Dictionary<Person, Professor>(); // 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<Person> Students => enrollees.Keys; // instance constructor public Person(string name, Professor supervisor) : this(name) { this.Enroll(supervisor); } }
C# 8.0: Records class Person(string First, string Last); class Person : IEquatable<Person> { 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); … }
Resources Language strategy C# design Roslyn 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
@roslyn @dcampbell @MadsTorgersen Where to find us At the “C#, Visual Basic and F#” booth @roslyn @dcampbell @MadsTorgersen
5/19/2018 1:01 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.