Skip to content

waf/DotNetConfThailand.2020.CSharp9

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What's new in C# 9.0

Presentation from .NET Conf Thailand 2020

See the stream here: https://www.youtube.com/watch?v=-iQkrvBBcTA

Contents

  • What's new in C# 9.0.pdf - slides (only two) from the presentation.
  • What's new in C#.ipynb - Jupyter notebook of new C# 9.0 features (uses dotnet interactive).
  • HelloWorld - A visual studio solution used during the presentation.

References

Questions

  • I heard will soon have record class and record struct?
    • Maybe! In C# 9, we just have record which means record class. In future versions of C# (e.g. 10) we might get new record class and record struct syntax; and record would continue to be a shorthand for record class.
  • Do we get C# 9 automatically when we create a .Net 5.0 project or do we need to do something else?
    • Yes! We get C# 9 automatically when we create a .NET 5.0 project.
  • Is Customer == null equal to Customer is null? Which one executes quicker?
    • They're not quite equal. If Customer implements an operator overload for equality, Customer == null will call that overload. The pattern matching approach, Customer is null, is guaranteed to do a real null check, regardless of any operator overload.
    • For this reason, since C# 7, the recommended way to null checks is to use Customer is null. In the absence of overloads, the performance is identical

Releases

No releases published

Packages

No packages published