Mert Özen Further With Every Line

Blog

Mert Özen's blog posts on software development, backend, frontend, and DevOps.

Series
480 posts found
Generic Classes, Generic Methods and Constraints in C#
Backend PART 02

Generic Classes, Generic Methods and Constraints in C#

Writing your own generic classes and methods: paging with Page<T>, the limits of type inference, default and the unconstrained T? trap. The class, struct, new(), notnull, unmanaged and Enum constraints with real compiler errors; per-closed-type statics and the == trap in generic code.

7 Nov 2026 10 min 11
Why C# Has Generics: ArrayList, Boxing and Type Safety
Backend PART 01

Why C# Has Generics: ArrayList, Boxing and Type Safety

The price of ArrayList storing everything as object: InvalidCastException pushed to run time, boxing of value types and eight times the memory. Type safety with List<T>, how the runtime sees generic types, and bringing old collections into the generic world with OfType and Cast.

7 Nov 2026 8 min 11
An Object-Oriented Mini Project in C#: the OOP Bookstore
Backend PART 16

An Object-Oriented Mini Project in C#: the OOP Bookstore

A small bookstore built from every piece of the series: record struct value objects, inheritance, indexers, stock notifications with events, checkout with composition, strategy and factory, a disposable log, and a bridge to the collections series.

7 Nov 2026 12 min 9
A Few Design Patterns in C#: Factory, Strategy and Observer
Backend PART 15

A Few Design Patterns in C#: Factory, Strategy and Observer

What design patterns are for, static factory methods and a switch-based factory, strategy with Func and interfaces, observer with events, isolating a broken subscriber, and subscription leaks.

7 Nov 2026 9 min 13
Partial, Nested Types, Anonymous Types and Tuples in C#
Backend PART 14

Partial, Nested Types, Anonymous Types and Tuples in C#

Equality and limits of anonymous types, returning several values with tuples, why tuple names exist only for the compiler, partial classes and methods, nested types, and when to pick which.

7 Nov 2026 9 min 12
Object Lifetime in C#: the Garbage Collector, IDisposable and using
Backend PART 13

Object Lifetime in C#: the Garbage Collector, IDisposable and using

When using cleans up, the garbage collector's generations and limits, implementing IDisposable correctly, why finalizers are rarely written, and the dispose pattern.

7 Nov 2026 9 min 10
Composition in C# and an Introduction to SOLID
Backend PART 12

Composition in C# and an Introduction to SOLID

How a cart derived from List leaks its rules, having instead of being with composition, the five SOLID principles through Bookstore examples, and the cost of overdoing them.

7 Nov 2026 10 min 11
Operator Overloading and Indexers in C#
Backend PART 11

Operator Overloading and Indexers in C#

Why operators are static methods and the trap that comes with it, arithmetic and comparison operators for Money, the compiler's rules, implicit/explicit conversions, indexers and Index/Range support.

7 Nov 2026 10 min 6
Equality and Comparison in C#: Equals, GetHashCode, IEquatable and IComparable
Backend PART 10

Equality and Comparison in C#: Equals, GetHashCode, IEquatable and IComparable

Reference and value equality, the Equals and GetHashCode contract, IEquatable<T> and the == operator, equality in structs, sorting with IComparable<T>, and comparers that decide from the outside.

7 Nov 2026 10 min 8
C# record and record struct: Value Equality and the with Expression
Backend PART 09

C# record and record struct: Value Equality and the with Expression

The members the compiler generates for a record, copying with with, positional and nominal records, EqualityContract in inheritance, C# 10's record struct, and when to pick a record.

7 Nov 2026 10 min 8
struct vs class in C#: Copy Semantics and readonly struct
Backend PART 08

struct vs class in C#: Copy Semantics and readonly struct

A struct is a value type: the copies hidden in properties, indexers and foreach, C# 10 parameterless constructors versus default, the inheritance rules of structs, an immutable Money with readonly struct and with, the second copy created by boxing, struct equality and when to make a type a struct.

7 Nov 2026 10 min 6
Interfaces in C#: Multiple and Explicit Implementation, Default Interface Methods
Backend PART 07

Interfaces in C#: Multiple and Explicit Implementation, Default Interface Methods

An interface is a contract: CS0535 and CS0144, a class implementing several interfaces, explicit implementation for same-named members and its examples in the BCL, default interface methods callable only through the interface, choosing between an interface and an abstract class, and testable code by putting the clock behind an interface.

7 Nov 2026 10 min 11
Blog Map