Ambesh Singh & Sachin Kumar

C# 13 Unleashed: Live Demos of my Top 10 Cutting-Edge Features!

What if `params` wasn't limited to arrays? See this and nine other game-changing features coming in C# 13.

C# 13 Unleashed: Live Demos of my Top 10 Cutting-Edge Features!
#1about 3 minutes

A brief history of C# from version 1 to 12

Key features like generics, LINQ, async/await, and records were introduced in major C# versions leading up to C# 13.

#2about 1 minute

How to set up your environment for C# 13

To use C# 13 features, you must install the .NET 9 SDK and use a recent preview version of Visual Studio 2022.

#3about 3 minutes

Using the enhanced params modifier with collections

The `params` modifier in C# 13 is no longer limited to arrays and can now be used with any collection type, including `ReadOnlySpan` or custom types.

#4about 2 minutes

Using the caret operator in object initializers

The caret operator (`^`) can now be used within object initializers to set collection elements from the end, simplifying code for tasks like countdowns.

#5about 3 minutes

Simplifying terminal output with the new escape sequence

C# 13 introduces the `\e` escape sequence as a more intuitive and less error-prone way to represent the escape character for terminal and console applications.

#6about 3 minutes

Separating definitions with partial properties and indexers

Partial properties and indexers allow you to split a property's declaration from its implementation across different parts of a partial class, which is useful for source generators.

#7about 6 minutes

Guiding overload resolution with a priority attribute

The `OverloadResolutionPriority` attribute allows library authors to guide the compiler in choosing a specific method overload, resolving ambiguities without breaking changes.

#8about 3 minutes

Improving thread synchronization with the new lock type

A new `System.Threading.Lock` type provides a more efficient and clearer way to handle thread synchronization in multi-threaded applications compared to traditional locking mechanisms.

#9about 4 minutes

Optimizing method group overload resolution

The compiler now handles method groups more efficiently by eliminating non-matching method candidates earlier in the process, improving performance in complex overload scenarios.

#10about 3 minutes

Using ref and unsafe contexts in async methods

C# 13 allows the use of `ref` local variables and `unsafe` contexts within async methods and iterators, with restrictions around `await` and `yield` boundaries to ensure safety.

#11about 2 minutes

Allowing ref struct types in generic parameters

You can now use `ref struct` types as generic type parameters by using the `allow-ref-struct` constraint, enabling more efficient generic algorithms.

#12about 3 minutes

Implementing interfaces with ref struct types

`ref struct` types can now implement interfaces, combining the performance benefits of `ref struct` with the abstraction provided by interfaces, though conversion to the interface type is restricted.

Related jobs
Jobs that call for the skills explored in this talk.

Featured Partners

Related Articles

View all articles
BR
Benjamin Ruschin
What Developers Really Need to Create Great Code Demos
Every developer on earth has, at some point, had another developer to thank for a breakthrough, a success, an aha moment they wouldn’t have had without coming across that blog post, that open-source contribution, that reply on socials or that humble ...
What Developers Really Need to Create Great Code Demos
CH
Chris Heilmann
WeAreDevelopers LIVE days are changing - get ready to take part
Starting with this week's Web Dev Day edition of WeAreDevelopers LIVE Days, we changed the the way we run these online conferences. The main differences are:Shorter talks (half an hour tops)More interaction in Q&AA tips and tricks "Did you know" sect...
WeAreDevelopers LIVE days are changing - get ready to take part
LM
Luis Minvielle
The Best Upcoming IT Webinars
Now that you already know what IT webinars are and how they can help you level up your professional appeal, you might want actually to get into one. Live tech webinars are one of the best ways to stay on top of the latest trends and tools because eit...
The Best Upcoming IT Webinars
CH
Chris Heilmann
Dev Digest 109 -Egg-citing things…
As we are heading into the Easter break, here are some things to spend some time on. There's resources on improving the performance of your code and you hear from the winners of CODE100 Amsterdam what it was like to be on stage. Also, hang tight as t...
Dev Digest 109 -Egg-citing things…

From learning to earning

Jobs that call for the skills explored in this talk.

C# Net Developer

C# Net Developer

Developerstrategicsiq Ltd
Bramley, United Kingdom

.NET
REST
Azure
NoSQL
DevOps
+4
Developer (C# .NET SQL)

Developer (C# .NET SQL)

Clerkenwell
Charing Cross, United Kingdom

API
.NET
Azure
Microservices
Continuous Integration