All posts with Tag basic

Preview image blogpost

Fundamentals – Part 14

When working with multithreaded applications, synchronization is essential to ensure that shared data is accessed safely. Without proper synchronization, threads can interleave unpredictably, leading to data corruption, race conditions, or inconsistent results. In this post, we’ll explore the main synchronization primitives in .NET: lock (Monitor), Semaphore, SemaphoreSlim, Interlocked, and ReaderWriterLockSlim.

Read the whole article

Preview image blogpost

Fundamentals – Part 13

Async and await make asynchronous programming feel simple — but there’s a lot happening behind the scenes. In this post, we’ll explore how the compiler rewrites async methods, what state machines and continuations are, and how to build one manually without using async/await.

Read the whole article

Preview image blogpost

Fundamentals – Part 12

Every allocation has a cost — but not all of them are obvious. In this post, we explore hidden heap allocations in C#: enumerators, boxing, closures, arrays, and strings. Learn how to spot them, measure them, and write allocation-free code.

Read the whole article

Preview image blogpost

Fundamentals – Part 11

Learn how Span<T>, Memory<T>, and their readonly variants enable high-performance, allocation-free data access in C#. We’ll explore when to use each, how they differ from arrays, and how ReadOnlySequence<T> powers streaming scenarios.

Read the whole article

Preview image blogpost

Fundamentals – Part 10

Generics provide type safety and performance in C#. In this post, we explore constraints, the Curiously Recurring Template Pattern (CRTP), and static abstract members in interfaces — advanced tools that make your APIs more reusable, expressive, and future-proof.

Read the whole article

Preview image blogpost

Fundamentals - Part 9

Extension methods look like they extend types, but they’re just static methods with special syntax. In this post, we’ll see how the compiler rewrites them, how they differ from instance methods, and why LINQ depends on them.

Read the whole article

Preview image blogpost

Fundamentals - Part 8

Why are static or sealed members more efficient? What are explicitly implemented interface methods? And how does the new keyword affect methods? In this post, we’ll break down these questions with clear explanations and practical C# examples.

Read the whole article

Preview image blogpost

Fundamentals - Part 7

Interfaces, virtual, and abstract methods form the backbone of polymorphism in C#. In this post, we’ll explore how they really work under the hood, with practical examples showing vtable dispatch, contracts, and inheritance in action.

Read the whole article

Preview image blogpost

Fundamentals - Part 6

Expression trees power LINQ providers like Entity Framework by turning your C# lambdas into data that can be translated into SQL. This post explains what expression trees are, how EF uses them, and how to create one yourself.

Read the whole article

Preview image blogpost

Fundamentals – Part 5

Reflection powers many C# frameworks, from Entity Framework and serializers to dependency injection and testing frameworks. In this post, we’ll explore how these tools use reflection behind the scenes, with practical examples to demystify the “magic” and deepen your C# fundamentals.

Read the whole article

Preview image blogpost

Fundamentals – Part 4

Nullable reference types go beyond just adding ? to your variables. In this post, we’ll explore how to guide the C# compiler using flow-aware attributes like [notnullwhen], [maybenull], and more — helping you write safer, clearer, and more reliable code.

Read the whole article

Preview image blogpost

Fundamentals – Part 3

Explore the inner workings of foreach loop — from compiler transformation and custom enumerators to yield return and deferred execution. This post breaks down essential concepts that every C# developer should understand to write safer, clearer, and more efficient iteration code.

Read the whole article

Preview image blogpost

Fundamentals - Part 2

Methods, Lambdas, and Local Functions in C# – What's the Difference? When learning C#, you’ll often hear about methods, lambdas, and local functions. While they all let you encapsulate code logic, they serve slightly different purposes and behave differently in a few key areas.

Read the whole article

Preview image blogpost

Fundamentals - Part 1

I recently bumped into this post on reddit. It caught my eye because it is a question that I always ask myself, do I know enough? Do I really understand how things are working under the hood? And if I do, is it enough?

So I went and dive in and took every bullet point and went deeper, went to find out how much do I really know. Let’s start with the first one

Read the whole article

An error has occurred. This application may no longer respond until reloaded. Reload x