Tag: csharp
74 posts · Page 2 of 8
2026-01-02 csharp-13csharpdotnet
C# 13: The End of `params` Allocations
C# 13 finally eliminates the hidden array allocation behind params. You can now use params with Span, ReadOnlySpan, List, and other collection types for zero-allocation variadic methods.
2026-01-02 csharpcsharp-proposals
C# Proposal: Discriminated Unions
A look at the C# discriminated unions proposal: the union keyword, exhaustive pattern matching, and how it could replace OneOf libraries and class hierarchies.
2025-04-09 csharp-14csharpdotnet
C# 14: Simplified parameters with modifiers in lambdas
C# 14 allows using ref, out, in, scoped, and ref readonly modifiers on implicitly typed lambda parameters, eliminating the need to explicitly declare parameter types.
2025-04-08 csharp-14csharpdotnet
Partial constructors and events in C# 14
C# 14 lets you declare instance constructors and events as partial members, splitting definitions across files for cleaner code generation and separation of concerns.
2025-04-07 csharp-14csharpdotnet
C# 14: nameof support for unbound generic types
C# 14 enhances the nameof expression to support unbound generic types like List<> and Dictionary<,>, eliminating the need for placeholder type arguments.
2025-04-06 csharp-14csharpdotnet
Implicit Span conversions in C# 14 – First-class support for Span and ReadOnlySpan
C# 14 adds built-in implicit conversions between Span, ReadOnlySpan, arrays, and strings, enabling cleaner APIs, better type inference, and fewer manual AsSpan() calls.
2025-04-05 csharp-14csharpdotnet
C# 14 – The field keyword and field-backed properties
C# 14 introduces the field contextual keyword for property accessors, letting you add custom logic to auto-properties without declaring a separate backing field.
2025-01-06 csharpdotnetdotnet-9
.NET Performance: ToList vs ToArray
.NET 9 significantly improves ToArray performance using InlineArray, making it faster and more memory-efficient than ToList. See benchmarks comparing .NET 8 vs .NET 9.
2025-01-02 csharp-13csharpdotnet
C# 13: Use params collections with any recognized collection type
C# 13 extends the params modifier beyond arrays to support Span, ReadOnlySpan, IEnumerable, and other collection types, reducing boilerplate and improving flexibility.
2025-01-01 csharp-13csharpdotnet
How to switch to C# 13
How to fix 'Feature is not available in C# 12.0' and switch your project to C# 13 by changing the target framework or setting LangVersion in your .csproj file.