Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
Nullable Reference Types in C# in Depth: NotNullWhen, MaybeNull and API Design
Flow analysis stopping at the method boundary and CS8602, a conditional contract with NotNullWhen and CS8762, an unconstrained T? staying plain T for value types, the generic Try pattern with MaybeNullWhen, NotNullIfNotNull, NotNull and AllowNull, MemberNotNull for CS8618, DoesNotReturn, the lack of runtime protection and ThrowIfNull, and #nullable and WarningsAsErrors for a gradual migration.
LINQ Element Operators: First, Last, Single, ElementAt and OrDefault
The First, Last, Single and ElementAt families and their OrDefault siblings; how 0 gets confused with 'not found' on value types, .NET 6's default value parameter and Index overloads, the difference in intent between First and Single, and nullable warnings.
Nullable in C#: int?, string? and Managing Null by Design
Working with null in C#: Nullable<T> and int?, lifted operators that compute with null, the nullable reference types of C# 8 and their warnings, flow analysis, the ?. ?? ??= and ! operators, and rules for managing null by design.