Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

O Futuro do C#: C#8

138 views

Published on

Apresentação feita no meetup delivering software.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

O Futuro do C#: C#8

  1. 1. w w w . l a m b d a 3 . c o m . b r O futuro do C#
  2. 2. Giovanni Bassi • Programador • MVP • Não gerente • Trouxe a Scrum.org, PSM e PSD pro Brasil • blog.lambda3.com.br, podcast.lambda3.com.br, dotnetarchitects.net • @giovannibassi • Escalador e ciclista
  3. 3. podcast.lambda3.com.br 0 – Eventos 1 – Docker 2 – .NET Core RC2 3 – Git 4 – Estudo 5 – Open Source 6 – Xamarin 7 – Node.js 8 – Democracia organizacional 9 – O programador poliglota ... Toda semana em:
  4. 4. stackoverflow.com/insights/survey/2017#most-popular-technologies
  5. 5. stackoverflow.com/insights/survey/2017#most-loved-dreaded-and-wanted
  6. 6. F# 10,000’s Tens of thousands VB 100,000’s Hundreds of thousands C# 1,000,000’s Millions
  7. 7. F# 10,000’s Tens of thousands VB 100,000’s Hundreds of thousands C# 1,000,000’s Millions
  8. 8. Demos!
  9. 9. var tuple = (f1: x.f1, f2: x?.f2); var tuple = (x.f1, x?.f2); https://github.com/dotnet/csharplang/blob/master/proposals/csharp-7.1/infer-tuple-names.md
  10. 10. static (int, int) Tally(int[] values) => default; https://github.com/dotnet/csharplang/blob/master/proposals/target-typed-default.md
  11. 11. static async Task Main() { // await ... } https://github.com/dotnet/csharplang/blob/master/proposals/async-main.md
  12. 12. IAsyncEnumerable<Person> people = database.GetPeopleAsync(); foreach await (var p in people) { … } using await (IAsyncDisposable resource = await store.GetRecordAsync(…)) { … }
  13. 13. 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); } }
  14. 14. 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); … } class Person(string First, string Last);

×