Mert Özen Further With Every Line

Blog

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

Series
150 posts found #csharp
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 10
Polymorphism in C#: virtual, override, new and Abstract Classes
Backend PART 06

Polymorphism in C#: virtual, override, new and Abstract Classes

Letting the runtime decide with virtual and override, an if-free cart loop for shipping costs, base calls and overriding ToString, hiding with new and the CS0114 trap, abstract classes and the template method, sealed override and the NullReferenceException of calling a virtual method from a constructor.

7 Nov 2026 10 min 9
Inheritance in C#: base, sealed and the Constructor Chain
Backend PART 05

Inheritance in C#: base, sealed and the Constructor Chain

Inheritance with Product, Book and EBook: what a derived class sees and protected, the constructor chain with base and the reverse order of field initializers, upcasting, downcasting, is and as, stopping derivation with sealed, and how an Order derived from List breaks encapsulation.

7 Nov 2026 11 min 8
Static Members, Static Classes and Extension Methods in C#
Backend PART 04

Static Members, Static Classes and Extension Methods in C#

Static fields and methods that belong to the type, the absence of this in static methods, const versus static readonly and when the static constructor runs, static classes, an ISBN-validating extension method, the rules of extensions and the threading trap of shared static state.

7 Nov 2026 9 min 9
Encapsulation and Access Modifiers in C#: public, private, protected, internal
Backend PART 03

Encapsulation and Access Modifiers in C#: public, private, protected, internal

Why a get-only List property protects nothing, keeping invariants inside the object, IReadOnlyList versus AsReadOnly, the six access modifiers and their defaults, private belonging to the type, and the assembly boundary with internal and InternalsVisibleTo.

7 Nov 2026 9 min 11
Fields, Properties and Constructors in C#: Building Objects Right
Backend PART 02

Fields, Properties and Constructors in C#: Building Objects Right

The parameterless constructor that disappears once you write your own, private and readonly fields, a validating property, auto-properties, get-only, private set, init and computed properties, constructor chaining and the order in which initializers run.

7 Nov 2026 10 min 9
Classes and Objects in C#: Writing Your First Own Type
Backend PART 01

Classes and Objects in C#: Writing Your First Own Type

A class is a recipe, an object is what it produces in memory. The first Book class with fields and methods, this, what being a reference type means, identity comparison with ==, null and NullReferenceException, and how classes are laid out in files and namespaces.

7 Nov 2026 9 min 7
C# Mini Project: A Console Bookstore (List, Add, Search, Save to a File)
Backend PART 20

C# Mini Project: A Console Bookstore (List, Add, Search, Save to a File)

The closing project of the C# Fundamentals series: a console Bookstore built with enums, DateOnly, nullable types, TryParse, exception filters and file I/O. Two real bugs caught on the first run (14,00 becoming 1400 and a silently deleted line), their fixes, and the bridge to the OOP series.

7 Nov 2026 13 min 11
Debugging in C#: Breakpoints, the Call Stack, Debug.Assert and Compiler Warnings
Backend PART 19

Debugging in C#: Breakpoints, the Call Stack, Debug.Assert and Compiler Warnings

Why doesn't Debug.WriteLine show up in the terminal, and why does Debug.Assert vanish in Release? Debugger concepts independent of the IDE, finding an integer division bug with a watch, reading a stack trace, the anatomy of dotnet build warnings, and turning nullable warnings into errors with WarningsAsErrors.

7 Nov 2026 9 min 10
Blog Map