Mert Özen Go Beyond the Code

Blog

Posts and series that take software and IT from the basics to advanced topics: from programming languages and databases to architecture and AI.

Series
1990 posts found
C# Versions: A Short History from 1.0 to 10
Backend PART 01

C# Versions: A Short History from 1.0 to 10

The signature features, release dates and .NET pairings of every version from C# 1.0 to C# 10; compiling the same code with different LangVersion values to see how the compiler tells you which feature came from which version.

7 Nov 2026 13 min 83
Unit Testing in C#: xUnit, Theory/InlineData and Testable Code
Backend PART 14

Unit Testing in C#: xUnit, Theory/InlineData and Testable Code

The hidden dependencies behind a flaky test, an xUnit test project, Fact and Assert, Theory/InlineData/MemberData, taking time from outside with IClock, and pitfalls like decimal InlineData and async void.

7 Nov 2026 8 min 107
Dependency Injection Basics in C#: Lifetimes, the Container and Captive Dependencies
Backend PART 13

Dependency Injection Basics in C#: Lifetimes, the Container and Captive Dependencies

Constructor injection with Microsoft.Extensions.DependencyInjection, singleton/scoped/transient, the container's disposal duty, captive dependencies and ValidateScopes, multiple registrations, TryAdd and factories.

7 Nov 2026 9 min 96
Performance in C#: Allocations, Structs and Measuring with BenchmarkDotNet
Backend PART 12

Performance in C#: Allocations, Structs and Measuring with BenchmarkDotNet

Why Stopwatch isn't enough, setting up BenchmarkDotNet 0.15.8 and reading its table, the measured difference between classes and structs, hidden allocations from boxing and closures, and benchmark pitfalls.

7 Nov 2026 10 min 86
Source Generators in C#: Generating Code at Compile Time with IIncrementalGenerator
Backend PART 11

Source Generators in C#: Generating Code at Compile Time with IIncrementalGenerator

Writing an incremental generator that adds code during the build: the netstandard2.0 project and Roslyn version, the pipeline and caching, seeing the generated code, and the partial and hint name pitfalls.

7 Nov 2026 9 min 84
Interop and unsafe Code in C#: P/Invoke, Pointers and fixed
Backend PART 10

Interop and unsafe Code in C#: P/Invoke, Pointers and fixed

AllowUnsafeBlocks and pointers, pinning against the GC with fixed, calling libc with DllImport, string marshalling, callbacks with function pointers, and keeping unsafe code small with NativeMemory and spans.

7 Nov 2026 7 min 71
ref Returns, ref Locals, in Parameters and ref struct in C#
Backend PART 09

ref Returns, ref Locals, in Parameters and ref struct in C#

Moving values by reference instead of copying them: ref locals, ref returns, ref readonly, the defensive-copy trap with in parameters, readonly structs and writing your own ref struct.

7 Nov 2026 10 min 82
Span<T> and Memory<T> in C#: Allocation-Free Parsing, stackalloc and ref struct Rules
Backend PART 08

Span<T> and Memory<T> in C#: Allocation-Free Parsing, stackalloc and ref struct Rules

Copy-free slicing and allocation-free parsing with Span<T>, a measured allocation difference, stackalloc and its safe pattern, ref struct restrictions, and Memory<T> for async code.

7 Nov 2026 10 min 80
Expression Trees in C#: Holding a Lambda as Data, and the Bridge to EF Core
Backend PART 07

Expression Trees in C#: Holding a Lambda as Data, and the Bridge to EF Core

The difference between Func and Expression<Func>, looking at the tree's nodes and Compile, building a dynamic filter with Expression factory methods, a small SQL translator with ExpressionVisitor, IQueryable and EF Core 6's ToQueryString output, a captured variable turning into a parameter, the untranslatable method error, limits such as CS0834, CS8072 and CS8110, and the 70-microsecond cost of Compile measured with BenchmarkDotNet.

7 Nov 2026 11 min 62
Attributes and Reflection in C#: Writing and Reading Your Own Attributes
Backend PART 06

Attributes and Reflection in C#: Writing and Reading Your Own Attributes

An attribute living in metadata and created when read, Obsolete and CS0618, AttributeUsage, positional and named arguments, decimal not being a valid attribute parameter and CS0181, a small validator with reflection, discovering IDiscountRule types and running them with Activator and Invoke, a BenchmarkDotNet comparison of GetValue, a cached PropertyInfo and a typed delegate, and the limits of trimming and source generators.

7 Nov 2026 11 min 78
Nullable Reference Types in C# in Depth: NotNullWhen, MaybeNull and API Design
Backend PART 05

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.

7 Nov 2026 9 min 85
Pattern Matching in C# in Depth: Property, Positional and Tuple Patterns
Backend PART 04

Pattern Matching in C# in Depth: Property, Positional and Tuple Patterns

Property patterns and the C# 10 extended syntax, a match that quietly fails at a null intermediate step, positional patterns with Deconstruct, a decision table with tuple patterns, not/and/or precedence and the is not A or B trap, the var pattern and when, missing and unreachable arms with CS8509, CS8524 and CS8510, and choosing between pattern matching and polymorphism.

7 Nov 2026 11 min 70
Blog Map