What's New in C# 14 + FREE Week at Zero To Mastery!


This week, I have two exciting things to share with you - a free deal and new C# 14 preview features.

Zero To Mastery Free Access

As a regular newsletter reader, you’ll know that I have a comprehensive C# and .NET Bootcamp course on Zero To Mastery.

This week (and next week), Zero To Mastery offers free access to their entire library of over 120+ courses for developers with 15,700 lessons and over 1500 video hours.

Categories include AI, machine learning, cyber security, design, cloud & DevOps, web3 & blockchain, besides regular development courses for JavaScript, TypeScript, Java, C#, Rust, etc.

Experts in their fields create those courses, and the courses have a very high-quality standard.

If you have never tried Zero To Mastery before, it’s the best time to try it for free.

Hint: Although the official website states only a single FREE week, using the link in this newsletter will grant you free access to Zero To Mastery until April 28th, 2025.

C# 14: Extension Members

With .NET 10 Preview 3, we got more news about extension members. Starting with C# 3, we were able to implement extension methods to extend sealed types.

Entire libraries, such as LINQ, are based on extension methods.

With C# 14, we now get extension members. Extension members allow us more flexibility when extending existing .NET types. For example, we can add static methods using the new syntax.

I highly recommend reading Vijay Anand’s comprehensive guide about extension members.

C# 14: Null-Conditional Assignment

​Null-conditional assignments provide a syntax known from TypeScript. It allows assigning a value only if the instance exists.

public void SetSalary(Employee? employee, decimal salary)
{
  if( employee is not null )
  {
    employee.Salary = salary;
  }
}

The code above can be simplified using Null-Conditional Assignments starting with C# 14:

public void SetSalary(Employee? employee, decimal salary)
{
  employee?.Salary = salary;
}

I’m curious about what’s coming with C# 14 and .NET 10 in the coming weeks and months. There are still about 4 months of development time left.