Paul Krill
Editor at Large

C# 13 enhances params, introduces extension types

news
May 21, 20242 mins

Forthcoming update to the C# language extends params parameter support and introduces a new type that supplies extension members for an underlying type.

agile change agent flexible dance balance skills by drew graham unsplash
Credit: Drew Graham

C# 13, a planned update to Microsoft’s popular general purpose language for .NET development, is set to enhance params parameters to give developers more flexibility, and to introduce extension types, a new kind of type that provides extension members for an underlying type.

Microsoft detailed the plans for C# 13 on May 21.

Beginning with C# 13, the params parameter type can be any of the types used with collection expressions such as Span<T>, List<T>, and IEnumerable<T>. Developers also can use their own collections if they follow special rules. Also, many methods of the .NET Runtime are being updated to accept params Span<T>, to reduce memory allocations and enable applications to run faster. This is part of an ongoing effort to make C# faster and more reliable. It also is an example of attention given to ensuring various C# features work well together, Microsoft said.

Extension types are a new kind of type that supplies extension members for an underlying type. Extension types have methods, properties, and other members that can be instance or static. Extension types allow developers to simplify the code that provides important work in an application, Microsoft said, by supplying and organizing extensions that customize specific instances of the underlying objects.

The new C# features can be tried in the .NET 9 Preview SDK or the latest Visual Studio 2022 IDE. Other improvements planned for C# 13 include field access in auto-properties and a revamped approach to breaking changes to ensure cleaner language evolution over the coming years.

Usually, official releases of C# occur alongside updates to .NET in November. C# 13 follows C# 12, which arrived in November 2023, featuring primary constructors and collection expressions. C# ranked as the fifth and fourth most popular programming language respectively in the Tiobe index and the Pypl index for this month.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author