What's new in C# 11 - David Wengier - NDC London 2023

Discover the latest features and advancements in C# 11, including raw strings, pattern matching, async constructors, and more, and learn how they can improve your development experience.

Key takeaways
  • What’s new in C# 11, featuring nint and nuint types which don’t use boxing like int and uint do
  • Raw string literals, which allow for easier string interpolation and formatting, and can include non-escaped newlines and quotes
  • Pattern matching, including support for switch expressions and list patterns, which can simplify code and reduce boilerplate
  • Async constructors, which allow for asynchronous object creation
  • scoped properties, which allow for properties that can only be set once
  • Records with optional syntax, which can simplify the creation of immutable classes *ρεfstructs, which are a new type of struct that can be used on the stack instead of the heap
  • The possibility of creating static abstract interfaces
  • The use of attributes, including the ability to create generic attributes
  • The improvement of the compiler’s error messages and diagnostics
  • The support for.NET 7 and later, including the use of memory storage and UTF-8 strings.