Table of Contents
C Sharp 11 - C# 11
Return to C Sharp Version History | Version History, C Sharp | C, dot NET | .NET, C Sharp DevOps | DevOps, C Sharp Security | Security, Cloud Native C Sharp | Cloud Native C, C Sharp Glossary | Glossary, C Sharp Reserved Words | Reserved Words, Awesome C Sharp | Awesome C, C Sharp 11 in a Nutshell | 11 in a Nutshell,
As of April 2023, C# 11 details were still emerging, with several proposed features aimed at improving the language's usability, safety, and conciseness. While a comprehensive list of every feature and fix in C# 11 could change as the final version is released, this summary will cover the features that were either confirmed or highly anticipated based on available information. For the most accurate and up-to-date information, please refer to the official C# documentation on the [.NET website](https://docs.microsoft.com/en-us/dotnet/csharp/), the [C# GitHub repository](https://github.com/dotnet/csharplang), the [official .NET website](https://dotnet.microsoft.com/), and C# details on [Wikipedia](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)).
Required Members
C# 11 introduces the concept of required members, which must be initialized when an object is created, enhancing object safety. This feature is somewhat similar to TypeScript's definite assignment assertions but goes further by enforcing initialization at compile time, akin to how Kotlin handles properties with its `lateinit` modifier. This feature is particularly useful for ensuring that objects are fully initialized before use, reducing the risk of null reference exceptions.
```csharp public class Person {
public required string Name { get; set; }} ```
List Patterns
List patterns enhance pattern matching in C# 11, allowing developers to match sequences against a list's elements. This feature brings C# closer to F#'s pattern matching capabilities and Python's sequence unpacking but remains unique in its integration with C#'s existing pattern matching features. List patterns can simplify complex conditional logic based on sequence contents.
```csharp var numbers = new[] { 1, 2, 3 }; if (numbers is [1, 2, 3]) { /* Match! */ } ```
Raw String Literals
Raw string literals in C# 11 make it easier to work with strings that contain many escape sequences, improving upon C#'s verbatim strings. This feature is directly inspired by similar features in Python's triple-quoted strings and JavaScript's template literals, allowing for multi-line strings and minimizing the need for escape sequences.
```csharp string path = “”“C:\Users\Example\Documents”“”; ```
Checked User-Defined Operators
C# 11 allows specifying checked contexts in user-defined operators, giving developers control over arithmetic overflow checking. This feature brings C# in line with C++'s explicit operator overloading capabilities and provides more fine-grained control than Java, which does not support operator overloading.
```csharp public static explicit operator CheckedInt(int value) checked ⇒ new CheckedInt(value); ```
Enhanced `#line` Pragmas
Enhanced `#line` pragmas in C# 11 improve source generator diagnostics by allowing better mapping of generated code back to the original source. This feature is unique to C# and doesn't have direct equivalents in languages like Java or Python but is similar in spirit to JavaScript's source maps, which facilitate debugging of minified code.
```csharp
- line “source-file.cs” 1
```
Generic Attributes
C# 11 introduces generic attributes, extending the language's attribute system to support generics. This feature is akin to Java's annotation system, which does not support generics in annotations. It allows for more expressive and flexible attribute definitions, enhancing meta-programming capabilities.
```csharp [AttributeUsage(AttributeTargets.Class)] public class MyAttribute<T> : Attribute { } ```
Pattern Matching Enhancements
Pattern matching in C# 11 sees further enhancements, making it more expressive and powerful. These improvements continue to evolve C#'s pattern matching capabilities beyond those in languages like Java, bringing it closer to the flexibility found in F# and Scala.
```csharp if (obj is Person { Name: “John”, Age: var age }) { /* Use age */ } ```
`param` Keyword for Lambda Expressions
The `param` keyword in C# 11 allows lambda expressions to explicitly specify their parameter types, improving clarity in complex expressions. This feature enhances lambda expression readability, similar to TypeScript's explicit type annotations for function parameters.
```csharp Func<int, int, int> add = (param int x, param int y) ⇒ x + y; ```
Static Abstract Members in Interfaces
C# 11 expands the concept of interfaces with static abstract members, allowing for richer abstractions and API designs. This feature, inspired by similar capabilities in Java's interface methods, enhances the expressiveness of interfaces in C#, enabling more sophisticated design patterns.
```csharp public interface IAddition<T> {
static abstract T Add(T a, T b);} ```
Record Structs
While introduced in C# 10, record structs continue to
be an important feature, representing immutable value types with value-based equality. This feature complements the record classes introduced earlier, bringing C#'s capabilities in line with value types in languages like F# and Scala.
```csharp public record struct Point(int X, int Y); ```
Each of these features represents an evolution in C#'s design, aiming to improve developer productivity, safety, and expressiveness. By borrowing concepts from other languages and introducing unique innovations, C# 11 continues to solidify its place as a modern, versatile programming language suitable for a wide range of applications.
Fair Use Sources
- C Sharp 11 on Github
C Sharp Versions: C Sharp | Programming Language. C Sharp 13 (2025), C Sharp 12 (2024), C Sharp 11 (2023), C Sharp 10 (2022), C Sharp 9 (2020), C Sharp 8 (2019), C Sharp 7.3 (2018), C Sharp 7.2 (2017), C Sharp 7.1 (2017), C Sharp 7 (2017), C Sharp 6 (2015), C Sharp 5 (2012), C Sharp 4 (2010), C Sharp 3 (2007), C Sharp 2 (2005), C Sharp 1 (2002). (navbar_csharp_versions - see also navbar_dotnet_versions, navbar_fsharp_versions, navbar_csharp)
C Sharp Vocabulary List (Sorted by Popularity)
C Sharp Programming Language, C Sharp Compiler, C Sharp Source Code, C Sharp Class, C Sharp Struct, C Sharp Interface, C Sharp Enum, C Sharp Delegate, C Sharp Event, C Sharp Method, C Sharp Property, C Sharp Field, C Sharp Indexer, C Sharp Constructor, C Sharp Destructor, C Sharp Static Constructor, C Sharp Nested Type, C Sharp Partial Class, C Sharp Partial Struct, C Sharp Partial Interface, C Sharp Partial Method, C Sharp Sealed Class, C Sharp Abstract Class, C Sharp Static Class, C Sharp Generic Class, C Sharp Generic Struct, C Sharp Generic Interface, C Sharp Generic Delegate, C Sharp Generic Method, C Sharp Type Parameter, C Sharp Type Argument, C Sharp In Type Parameter, C Sharp Out Type Parameter, C Sharp Variance, C Sharp Covariance, C Sharp Contravariance, C Sharp Attribute, C Sharp Conditional Attribute, C Sharp Obsolete Attribute, C Sharp AttributeUsage Attribute, C Sharp CallerMemberName Attribute, C Sharp CallerLineNumber Attribute, C Sharp CallerFilePath Attribute, C Sharp ParamArray Attribute, C Sharp Partial Keyword, C Sharp Internal Keyword, C Sharp Protected Keyword, C Sharp Private Keyword, C Sharp Public Keyword, C Sharp Static Keyword, C Sharp Virtual Keyword, C Sharp Override Keyword, C Sharp Abstract Keyword, C Sharp Sealed Keyword, C Sharp Readonly Keyword, C Sharp Const Keyword, C Sharp Volatile Keyword, C Sharp Unsafe Keyword, C Sharp Checked Keyword, C Sharp Unchecked Keyword, C Sharp Fixed Keyword, C Sharp Lock Keyword, C Sharp Using Keyword, C Sharp Namespace Keyword, C Sharp Class Keyword, C Sharp Struct Keyword, C Sharp Interface Keyword, C Sharp Enum Keyword, C Sharp Delegate Keyword, C Sharp Event Keyword, C Sharp This Keyword, C Sharp Base Keyword, C Sharp As Keyword, C Sharp Is Keyword, C Sharp In Keyword, C Sharp Out Keyword, C Sharp Ref Keyword, C Sharp Out Parameter, C Sharp In Parameter, C Sharp Params Parameter, C Sharp Extern Keyword, C Sharp Partial Modifier, C Sharp New Modifier, C Sharp Async Keyword, C Sharp Await Keyword, C Sharp Var Keyword, C Sharp Dynamic Keyword, C Sharp Default Literal, C Sharp Null-Coalescing Operator, C Sharp Null-Coalescing Assignment Operator, C Sharp Null-Conditional Operator, C Sharp Nameof Operator, C Sharp Pattern Matching, C Sharp Switch Expression, C Sharp Is Pattern Expression, C Sharp When Clause, C Sharp Relational Pattern, C Sharp Logical Pattern, C Sharp Not Pattern, C Sharp And Pattern, C Sharp Or Pattern, C Sharp Property Pattern, C Sharp Positional Pattern, C Sharp Discard Pattern, C Sharp Tuple Pattern, C Sharp List Pattern, C Sharp Slice Pattern, C Sharp Primary Constructor, C Sharp Record Type, C Sharp Record Class, C Sharp Record Struct, C Sharp With Expression, C Sharp Init-Only Property, C Sharp Target-Typed New, C Sharp Expression-Bodied Member, C Sharp Expression-Bodied Property, C Sharp Expression-Bodied Method, C Sharp Expression-Bodied Constructor, C Sharp Expression-Bodied Destructor, C Sharp Expression-Bodied Indexer, C Sharp Auto-Property, C Sharp Auto-Property Initializer, C Sharp Backing Field, C Sharp Accessor, C Sharp Getter, C Sharp Setter, C Sharp Init Accessor, C Sharp Add Accessor, C Sharp Remove Accessor, C Sharp Event Accessor, C Sharp Readonly Auto-Property, C Sharp Required Keyword, C Sharp File-Scoped Namespace, C Sharp Global Using Directive, C Sharp Interpolated String, C Sharp Raw String Literal, C Sharp Unicode Escape, C Sharp Verbatim String Literal, C Sharp Digit Separator, C Sharp Binary Literal, C Sharp Ref Struct, C Sharp Readonly Struct, C Sharp Span Type, C Sharp Memory Safety, C Sharp Safe Code, C Sharp Unsafe Code, C Sharp Pointer Type, C Sharp Fixed Statement, C Sharp Stackalloc Keyword, C Sharp Managed Type, C Sharp Unmanaged Type, C Sharp Boxing, C Sharp Unboxing, C Sharp Conversion Operator, C Sharp Implicit Operator, C Sharp Explicit Operator, C Sharp User-Defined Conversion, C Sharp Operator Overloading, C Sharp Arithmetic Operator, C Sharp Comparison Operator, C Sharp Logical Operator, C Sharp Conditional Operator, C Sharp Null-Conditional Operator, C Sharp Index Operator, C Sharp Range Operator, C Sharp Member Access Operator, C Sharp Lambda Expression, C Sharp Anonymous Method, C Sharp Delegate Type, C Sharp Multicast Delegate, C Sharp Func Delegate, C Sharp Action Delegate, C Sharp Predicate Delegate, C Sharp Lambda Operator, C Sharp Statement Lambda, C Sharp Expression Lambda, C Sharp Closure, C Sharp Captured Variable, C Sharp Local Function, C Sharp Local Static Function, C Sharp Local Variable, C Sharp Local Constant, C Sharp Block Scope, C Sharp Lexical Scope, C Sharp Lifetime, C Sharp Using Statement, C Sharp Await Using, C Sharp Await Foreach, C Sharp Asynchronous Streams, C Sharp IAsyncEnumerable, C Sharp IAsyncEnumerator, C Sharp IAsyncDisposable, C Sharp Task-Based Asynchronous Pattern, C Sharp Async Method, C Sharp Async Lambda, C Sharp Async Local Function, C Sharp Iterator, C Sharp Yield Keyword, C Sharp Yield Return, C Sharp Yield Break, C Sharp Foreach Statement, C Sharp For Statement, C Sharp While Statement, C Sharp Do Statement, C Sharp If Statement, C Sharp Else Statement, C Sharp Switch Statement, C Sharp Break Statement, C Sharp Continue Statement, C Sharp Return Statement, C Sharp Goto Statement, C Sharp Checked Statement, C Sharp Unchecked Statement, C Sharp Lock Statement, C Sharp Fixed Statement, C Sharp Unsafe Statement, C Sharp Try Statement, C Sharp Catch Clause, C Sharp Finally Clause, C Sharp Throw Statement, C Sharp Throw Expression, C Sharp Exception Handling, C Sharp Exception Filter, C Sharp Using Declaration, C Sharp Disposal Pattern, C Sharp IDisposable Interface, C Sharp IAsyncDisposable Interface, C Sharp Pattern Variable, C Sharp Pattern Arm, C Sharp Pattern Switch, C Sharp Pattern-Based If, C Sharp Pattern-Based While, C Sharp Pattern Guards, C Sharp Partial Aggregation (use once), C Sharp Code Generation Attribute, C Sharp Interpolated Verbatim String, C Sharp Caller Argument Expression Attribute, C Sharp Index Type, C Sharp Range Type, C Sharp Indexing, C Sharp Slicing, C Sharp Deconstruction, C Sharp Deconstruct Method, C Sharp Tuple Type, C Sharp Tuple Literal, C Sharp Tuple Deconstruction, C Sharp Named Tuple Element, C Sharp Discards, C Sharp Out Variable, C Sharp Out Declaration, C Sharp Object Initializer, C Sharp Collection Initializer, C Sharp Anonymous Type, C Sharp Anonymous Object Initializer, C Sharp Query Expression, C Sharp From Clause, C Sharp Where Clause, C Sharp Select Clause, C Sharp Group Clause, C Sharp Into Clause, C Sharp Join Clause, C Sharp Let Clause, C Sharp Orderby Clause, C Sharp Ascending Keyword, C Sharp Descending Keyword, C Sharp Query Variable, C Sharp Range Variable, C Sharp Method Syntax, C Sharp Query Syntax, C Sharp LINQ, C Sharp Deferred Execution, C Sharp Expression Tree, C Sharp Lambda Parameter, C Sharp Parameter Default Value, C Sharp Named Argument, C Sharp Optional Parameter, C Sharp Constructor Initializer, C Sharp Base Initializer, C Sharp This Initializer, C Sharp Object Creation Expression, C Sharp Anonymous Function, C Sharp Captured Environment, C Sharp Partial Type Definition, C Sharp Partial Generic Type, C Sharp Generic Constraint, C Sharp Where Clause (Generic), C Sharp Class Constraint, C Sharp Struct Constraint, C Sharp Unmanaged Constraint, C Sharp Notnull Constraint, C Sharp Nullable Context, C Sharp Nullable Reference Type, C Sharp Non-Nullable Reference Type, C Sharp Null-Forcing Operator, C Sharp Null Forgiving Operator, nullable Directive, C Sharp Null State, C Sharp Nullability Analysis, C Sharp Dataflow Analysis, C Sharp Roslyn Analyzer (Roslyn is part of C# ecosystem), C Sharp Code Fix Provider, C Sharp Source Generator, C Sharp Incremental Generator, C Sharp Language Version, C Sharp Language Specification, C Sharp Language Design, C Sharp Language Proposal, C Sharp Language Feature, C Sharp Experimental Feature, C Sharp Preview Feature, C Sharp Backward Compatibility, C Sharp Forward Compatibility, C Sharp Overload Resolution, C Sharp Type Inference, C Sharp Return Type Inference, C Sharp Local Type Inference, C Sharp Anonymous Methods, C Sharp Implicitly Typed Local Variable, C Sharp Implicitly Typed Array, C Sharp Collection Initializer, C Sharp Object Initializer Expression, C Sharp Dataflow Variable State, C Sharp Null State Analysis, C Sharp Null Tracking, C Sharp Extended Property Patterns, C Sharp Target-Typed New Expression, C Sharp Lambda Discard Parameters, C Sharp Lambda Attributes, C Sharp Attributes on Local Functions, C Sharp Attributes on Lambda Expressions, C Sharp Record Equality, C Sharp Record Positional Parameters, C Sharp Primary Constructor Parameters, C Sharp Inferred Tuple Element Name, C Sharp Inferred Anonymous Type Property Name, C Sharp Deconstruction Assignment, C Sharp Deconstruction Declaration, C Sharp Pattern Combinators, C Sharp Switch Expression Arm, C Sharp Exhaustive Pattern Matching, C Sharp Ref Return, C Sharp Ref Local, C Sharp Ref Readonly, C Sharp Writeable Ref, C Sharp Inline Array, C Sharp Raw String Literals, C Sharp UTF-8 String Literals, C Sharp File Keyword (for namespaces), C Sharp Required Members, C Sharp Required Keyword, C Sharp Statically Resolved Type Parameter (conceptual), C Sharp Lifted Operators, C Sharp Lifted Conversions, C Sharp Lifted Nullable Types, C Sharp Partial Struct Methods, C Sharp Partial Record, C Sharp Partial Record Struct, C Sharp Interpolated String Handler, C Sharp AndAlso Operator (&&), |), C Sharp Lifted Boolean Operators, C Sharp Conversion Operator Overload, C Sharp Equality Contract, C Sharp With Expression on Record, C Sharp Record Clone, C Sharp Equality Members in Record, C Sharp Deconstruct Method in Record, C Sharp Init Accessor in Record, C Sharp Primary Constructor in Record, C Sharp Value Equality in Record, C Sharp Dataflow Warnings, C Sharp SuppressNullableWarning, pragma Warning Directive, line Directive, region Directive, endregion Directive, if Directive, else Directive, elif Directive, endif Directive, define Directive, undef Directive, error Directive, warning Directive, pragma warning disable, pragma warning restore, C Sharp Interpolated String Alignment, C Sharp Interpolated String Format Specifier, C Sharp Switch Expression Guards, C Sharp Switch Expression Arms, C Sharp Expression Bodied Accessor, C Sharp Expression Bodied Indexer, C Sharp Expression Bodied Ctor, C Sharp Expression Bodied Dtor, C Sharp Async Streams, C Sharp Await Foreach (Async), C Sharp Await Using (Async), C Sharp Async Disposable Pattern, C Sharp Async Iterator, C Sharp IAsyncEnumerable Interface, C Sharp IAsyncEnumerator Interface, C Sharp Configurable Nullability, C Sharp Null State Merging, C Sharp Null State Splitting, C Sharp Null-forgiving Operator (!), C Sharp Indices and Ranges, C Sharp Index Struct, C Sharp Range Struct, C Sharp Pattern-Based Disposal, C Sharp Pattern-Based Deconstruction, C Sharp Pattern Variables in Condition, C Sharp Pattern Variables in Switch, C Sharp Pattern Variables in Is Expression, C Sharp Is Pattern Expression With Variable, C Sharp Pattern Matching Enhancements, C Sharp Recursive Patterns, C Sharp Extended Property Patterns, C Sharp Combine Patterns, C Sharp Logical Patterns, C Sharp Relational Patterns, C Sharp Pattern In Switch Arm, C Sharp Discard Pattern in Switch, C Sharp Asynchronous Disposable, C Sharp IAsyncDisposable in Using, C Sharp Local Static Function, C Sharp Lambda Attributes Application, C Sharp Lambda Return Type Inference, C Sharp Lambda Parameter Inference, C Sharp Lambda Expression Tree Conversion, C Sharp Method Group Conversion, C Sharp Tasklike Type, C Sharp Async Method Builder, C Sharp Move Next State Machine Method, C Sharp Awaiter Pattern, C Sharp GetAwaiter Method, C Sharp IsCompleted Property, C Sharp GetResult Method, C Sharp Pattern Variables in Let Clause, C Sharp pattern Variables in from Clause, C Sharp Null Conditional in Query, C Sharp Null Coalescing in Query, C Sharp Query Continuation, C Sharp Query Transparency, C Sharp Transparent Identifier, C Sharp Range Variable Shadows, C Sharp Overload Resolution on Tuples, C Sharp Overload Resolution on Lambdas, C Sharp Overload Resolution on Nullable, C Sharp Overload Resolution on Indexers, C Sharp ref struct Constraints, C Sharp Interpolated String Const, C Sharp Interning Strings, C Sharp String Interpolation Hole, C Sharp Switch Expression Patterns, C Sharp Switch Expression Exhaustiveness, C Sharp Switch Expression Default Arm, C Sharp Pattern-Based is Operator, C Sharp Pattern in If Statement, C Sharp Pattern in While Statement, C Sharp Pattern in Match Expression, C Sharp Pattern in Let Declaration, C Sharp Pattern in Deconstruction Declaration, C Sharp Unit Testing with C Sharp Assertions (Refers specifically to C# testing frameworks), C Sharp Caller Information Attributes, line Directive, pragma warning suppress, pragma warning hint, pragma warning safeonly (hypothetical), C Sharp Source Generator Pipeline, C Sharp Incremental Source Generator, C Sharp Stable Language Features, C Sharp Deprecated Language Features, C Sharp Backwards Compatibility Mode, C Sharp Expression Trees, C Sharp Expression Tree Lambda, C Sharp Expression Tree Parameter, C Sharp Expression Tree Body, C Sharp Expression Tree Visitor, C Sharp Expression Bodied get, C Sharp Expression Bodied set, C Sharp Expression Bodied add, C Sharp Expression Bodied remove, C Sharp Caller Argument Expression, C Sharp Caller Info Attributes Application, C Sharp Enhancements to Partial Methods, C Sharp Partial Method Implementation, C Sharp Partial Method Signature, C Sharp Partial Method Constraints, C Sharp Partial Record Parameter, C Sharp Partial Class Constraints, C Sharp Partial Generic Constraint.
C Sharp: Effective C Sharp, C Sharp Best Practices, C Sharp Fundamentals, C Sharp Inventor - C Sharp Language Designer: Anders Hejlsberg of Microsoft in January 2000, Now Mads Torgersen is Primary Architect; Dot Net, C# Keywords, Avalonia, C Sharp on Linux, C Sharp on macOS, C Sharp on Windows, C Sharp on Android, C Sharp on iOS, C Sharp Installation (choco install dotnet, brew install dotnet), C Sharp Containerization (C Sharp with Docker, C Sharp with Podman, C Sharp and Kubernetes, C Sharp Built-In Data Types, C Sharp Data Structures - C Sharp Algorithms, C Sharp Syntax, C Sharp OOP - C Sharp Design Patterns, Clean C Sharp | Clean C - C Sharp Style Guide | Style Guide, C Sharp Best Practices | Best Practices (C Sharp Core Guidelines (CG) | Core Guidelines (CG), ) - C Sharp BDD | BDD, C Sharp Compiler | Compiler, C Sharp IDEs | IDEs (Visual Studio, Visual Studio Code, JetBrains Ryder), C Sharp Development Tools | Development Tools, C Sharp Linter | Linter, C Sharp Debugging | Debugging, C Sharp Modules | Modules, C Sharp Packages | Packages, C Sharp Package Manager | Package Manager (NuGet), C Sharp Standard Library | Standard Library, C Sharp libraries | libraries, C Sharp frameworks | frameworks, C Sharp DevOps | DevOps - C Sharp SRE | SRE, C Sharp dot NET and Databases | .NET and Databases (LINQ and Entity Framework ORM), C Sharp Data Science | Data Science - C Sharp DataOps | DataOps, C Sharp Machine Learning | Machine Learning - ML.NET, C Sharp Deep Learning | Deep Learning, Functional C Sharp | Functional C, C Sharp Concurrency | Concurrency, C Sharp Parallel Programming | Parallel Programming, Async C Sharp | Async C, C Sharp History | History, C Sharp Bibliography | Bibliography, Manning C Sharp Series, C Sharp Courses | Courses, C Sharp Glossary | Glossary, C Sharp Versions | Versions, C Sharp Topics | Topics, C Sharp Research | Research, C Sharp GitHub | GitHub, Written in C Sharp | Written in C, C Sharp Popularity, C Sharp Awesome. (navbar_csharp - see also navbar_csharp_versions, navbar_dotnet, navbar_dotnet_versions, navbar_csharp_libraries, navbar_csharp_standard_library, navbar_fsharp)
Cloud Monk is Retired ( for now). Buddha with you. © 2025 and Beginningless Time - Present Moment - Three Times: The Buddhas or Fair Use. Disclaimers
SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.