Modern C# gives us advanced nullability checking. Let’s take a look at C# nullability and the !, ?, ??, and ??= operators that support it.
Language Features
-
-
Over the weekend I discovered a new feature in Visual Studio 2022 for C# code. This feature, which I’m referring to as “Inline Diagnostics” allows you to see compiler warnings and errors in your editor window without needing to hover over the tooltips.
-
Expression-bodied members in C# can be complex and confusing. Lets talk about the use of fat arrows to declare simple methods and properties and its impact on code and developers.
-
New and old ways of creating your own exceptions in dotnet with C# 11 and .NET 7
-
Most of the new features in C# 11 are incremental language improvements. However, one of these features stuck me immediately as something we don’t need – and also really need to do more.
-
The C# 11 required keyword lets you reduce constructor boiler plate code and ensure that new objects have required property members set when using inline initializers.
-
The C# nameof expression is not going to revolutionize the way you write code, but it is likely to improve the maintainability and accuracy of the code – at least a little bit.
-
In this article we’ll explore what generics are in C# and how implementing your own generic types and generic methods in C# can help level up your coding ability.
-
Newer .NET developers are sometimes confused when they encounter readonly members in classes and the newer init-only setters. In this article we’ll explore both keywords along with the related get-only auto property. Finally, we’ll help you understand when to use each of these powerful language features.
-
C# 9 added the “Target-typed new” keyword, which is a little bit of a mouthful, but a powerful feature for simplifying your C# code. In this article we’ll look at…