tags

Csharp

Interesting new C# 14 features coming with .NET 10

With the release of .NET 10 just around the corner (next month!), it’s time to take a look at the new features we can expect for C# 14. Note: the goal of this post is not to be an exhaustive list of all new features. I will only cover the ones that seem the most interesting to me. This doesn’t mean the features I don’t mention are useless, but they just have more niche use cases so they probably won’t have as much impact on most developers.

C# methods in git diff hunk headers

If you use git on the command line, you may have noticed that diff hunks often show the method signature in the hunk header (the line that starts with @@), like this: diff --git a/Program.cs b/Program.cs index 655a213..5ae1016 100644 --- a/Program.cs +++ b/Program.cs @@ -13,6 +13,7 @@ static void Main(string[] args) Console.WriteLine("Hello World!"); Console.WriteLine("Hello World!"); Console.WriteLine("Hello World!"); + Console.WriteLine("blah"); } This is very useful to know where you are when looking at a diff.