A sixteen-part deep dive into C# nullable reference types — from the new default to advanced nullability attributes and generics.
C# Nullable References
C# 8.0 nullable references: non-nullable is the new default
Explore C# 8.0's nullable references feature, as Ian discusses its impact on default nullability assumptions in this informative post.
C# 8.0 nullable references: embrace the expressiveness
Beyond catching null bugs at compile time, C# 8.0 nullable references record null intent directly in source, so future readers don't have to guess the design.
C# 8.0 nullable references: getting started in an existing codebase
C# 8.0's nullable references feature dramatically changes a fundamental aspect of the language. In this post, Ian explains how to you can soften the impact by enabling gradually across your projects.
C# 8.0 nullable references: inferred (non-)nullness
Nullable references is C# 8.0's most ambitious feature. Flow analysis lets the compiler tell when a reference is definitely not null, cutting spurious warnings.
C# 8.0 nullable references: transcending types with AllowNull
Explore C# 8.0 nullable references & AllowNull attribute for better null-related bug detection and enhanced expressiveness in properties & generics.
C# 8.0 nullable references: better results with nullability attributes
C# 8.0 nullable references enable us to annotate our code with information that lets the compiler discover possible null-related bugs.
C# 8.0 nullable references: conditional post-conditions
Explore C#8's NotNullWhen, MaybeNullWhen, & NotNullIfNotNull attributes for improved nullability warnings, aiding method output inference from inputs.
C# 8.0 nullable references: MaybeNull
The MaybeNull attribute enables C#8's nullable references feature to provide more useful warnings, by helping it infer information about a method output.
C# 8.0 nullable references: transcendence with DisallowNull
C# 8.0 nullable references help identify potential null-related bugs. DisallowNull attribute enhances properties and generics.
C# 8.0 nullable references: supporting older runtimes
See how to use C# 8.0 nullable references even when targetting older versions of .NET that don't officially support it.
C# 8.0 nullable references: when methods don't return
Explore the importance of DoesNotReturn & DoesNotReturnIf attributes in C# 8 nullable references, enhancing their long-standing role in C#.
C# 8.0 nullable references and serialization
C# 8's nullable references feature can clash with common serialization techniques. This article shows how to deal with that.
C# 8.0 nullable references: defeating the point with empty strings
Enabling C# 8's nullable references feature often produces a lot of warnings. Avoid the temptation to make some go away by initializing properties to empty strings.
C# 8.0 nullable references: NotNull
The NotNull attribute enables C#8's nullable references feature to provide more useful warnings, by helping it infer information about a method argument.
C# 8.0 nullable references: prepare today by not misusing 'as'
Develop habits that smooth the path to C# 8.0 nullable references: starting with avoiding the common misuse of the 'as' operator. Use casts or pattern matching.
C# 10.0 improves nullable references in generics: no more AllowNull
Explore C# 10.0's improved nullability annotations in generic code, replacing AllowNull with more intuitive syntax.