C# 13 new features

In November 2024, Microsoft released C# 13.
It’s not a huge overhaul, but it removes some long-standing restrictions and introduces features that make code cleaner, safer, and easier to write.

Here are the highlights — with before vs after examples.


params collections

Before, params was limited to arrays.

Before

After


New lock semantics

When locking on System.Threading.Lock, the compiler now uses EnterScope() under the hood.

Before

This used the Monitor API.

After

Which is equivalent to:


Escape sequence \e

Now you can use \e for the ESC character.

Before

After


Overload resolution improvements

Ambiguous overloads are resolved better.

Before

After


Indexers in initializers

The ^ (from end) operator can now be used in initializers.

Before

After


ref in iterators and async methods

Before

After


ref struct and interfaces

Before

After


ref struct in generics

Before

After


Partial properties and indexers

Before

After


Conclusion

post image

C# 13 is a quality-of-life release.
The changes are small, but together they:

  • Remove old limitations (ref struct with interfaces/generics).
  • Improve expressiveness (\e, params collections).
  • Make code more consistent (lock, partial properties).

It’s a great step forward, especially if you write libraries, low-level code, or high-performance apps.

Tutorials

Articles

Labs