Skip to content

~ / blog / category · 23 entries

grep -r "C#"

  1. SOLID in C#: Five Principles, One Idea

    SOLID explained with real C# examples: single responsibility, open/closed, Liskov, interface segregation and dependency inversion, plus interview Q&As.

    C# 11 min read
  2. C# Dependency Injection: Stop Calling new Inside Your Classes

    Dependency injection in .NET explained from zero: inversion of control, constructor injection, singleton vs scoped vs transient, captive dependencies, and Q&As.

    C# 10 min read
  3. C# Reflection and Attributes: How Frameworks Read Your Code

    Reflection and attributes explained: Type, GetProperties, custom attributes, how ASP.NET and EF use them, the performance cost, and interview Q&As.

    C# 10 min read
  4. C# Thread Safety: Race Conditions, lock, and Why i++ Is Not Atomic

    Threads vs tasks, race conditions, the lock statement, Interlocked, deadlocks, volatile, concurrent collections and immutability. With interview Q&As.

    C# 11 min read
  5. C# async and await: Waiting Without Blocking a Thread

    async/await from zero: what a Task really is, why async is not multithreading, deadlocks from .Result, async void, ConfigureAwait, and interview Q&As.

    C# 11 min read
  6. C# IDisposable and the Garbage Collector: What the GC Will Not Clean Up

    How the .NET GC works with generations, why IDisposable exists, using statements, the dispose pattern, finalizers, and interview questions answered.

    C# 11 min read
  7. C# Exceptions: throw vs throw ex and Other Ways to Lose a Stack Trace

    C# exception handling done properly: try/catch/finally, why throw ex destroys the stack trace, custom exceptions, filters, and interview questions answered.

    C# 11 min read
  8. C# Null Handling: Killing the Billion Dollar Mistake

    Nullable reference types, ?. ?? and !, why the null-forgiving operator is dangerous, guard clauses, Option-style results, and interview questions answered.

    C# 10 min read
  9. C# Pattern Matching: switch Expressions and the End of if-else Chains

    C# pattern matching from zero: is patterns, switch expressions, property and relational patterns, list patterns, exhaustiveness, and interview Q&As.

    C# 10 min read
  10. C# Collections: Picking Between List, Dictionary and HashSet

    How List, Dictionary, HashSet, Queue and Stack work internally, their Big-O costs, when each one wins, and the O(n^2) loop to avoid. With interview Q&As.

    C# 10 min read
  11. C# Equality: Equals, GetHashCode and the Bug That Loses Your Data

    Equals vs ==, ReferenceEquals, why GetHashCode must match Equals, IEquatable, IComparable, and the mutable key bug. With interview questions answered.

    C# 11 min read
  12. C# Records: The Class That Writes Its Own Equality

    C# records from zero: positional syntax, value equality, init-only properties, with expressions, record struct, and when not to use one. With interview Q&As.

    C# 10 min read
  13. C# Polymorphism: virtual, override, and the new Keyword That Lies

    Inheritance and polymorphism in C#: virtual vs override vs new, abstract and sealed, base calls, why composition usually wins, and interview Q&As.

    C# 11 min read
  14. C# Interfaces vs Abstract Classes: Contract or Half-Built Thing

    When to use an interface and when an abstract class: what each can hold, multiple inheritance, default interface methods, testing, and interview Q&As.

    C# 11 min read
  15. C# Strings: Immutability, StringBuilder and the Loop That Kills Performance

    Why C# strings are immutable, string interning, when StringBuilder actually wins, ordinal vs culture comparison, spans and interview questions answered.

    C# 10 min read
  16. C# Value Types vs Reference Types: What the Variable Actually Holds

    Struct vs class, stack vs heap, copying, ref and out, boxing and why it costs, nullable value types, and interview questions answered from zero.

    C# 12 min read
  17. C# Events: A Delegate With a Lock on the Front Door

    C# events from zero: why event exists on top of delegates, EventHandler, the null-safe raise pattern, memory leaks from unsubscribing, and interview Q&As.

    C# 11 min read
  18. C# IEnumerable and yield return: How foreach Actually Works

    IEnumerable, IEnumerator and the state machine behind yield return: lazy sequences, infinite streams, IEnumerable vs List, and interview questions answered.

    C# 11 min read
  19. C# Extension Methods: Adding Methods to Types You Do Not Own

    How extension methods work, the this keyword on a parameter, why LINQ is built from them, when they beat helper classes, and interview questions answered.

    C# 10 min read
  20. C# LINQ: Every foreach Loop You Never Have to Write Again

    LINQ from zero: Where and Select, method vs query syntax, deferred execution, IEnumerable vs IQueryable in EF Core, and interview questions answered.

    C# 10 min read
  21. C# Lambda Expressions: A Method Without a Name

    C# lambdas from zero: the => arrow, how lambdas fill delegates, Func and Predicate, closures, expression trees, and interview questions answered.

    C# 9 min read
  22. C# Generics Explained From Zero

    C# generics from zero: why they beat object, how constraints buy abilities with restrictions, and generic methods. With 10 interview questions answered.

    C# 11 min read
  23. C# Delegates: A Variable That Holds a Method

    C# delegates from zero: a variable that holds a method, indirection, Action and Func, where they run in production, and interview questions answered.

    C# 9 min read
CV