/csharp
The language itself. Pattern matching, nullable reference types, records, and the features people skip because the old way still compiles.
Everything filed under csharp
ArticleVirtual vs Override vs Partial in C# Explained with Small Runnable Examples
Virtual, override and partial are tiny C# keywords with huge impact on design. This post explains how they work, when to use them, and where bugs appear. Learn the difference between override and new, why sealed override matters, and how partial classes and partial methods keep generated and hand written code happy. Every section comes with short, runnable snippets and real project tips.
4 min1 like0 comments ArticleSealed by Default in .NET: when it Shines and when it Bites
Sealed looks like a tiny keyword, but it carries serious weight in modern .NET. This post explains what sealed does at class and member level, why the JIT can make sealed code faster, when you should not seal, and how to keep code testable with interfaces. You will see small, runnable examples and practical patterns that balance performance, clarity, and flexibility.
5 min0 likes0 comments ArticleSmarter Error Handling in C#: Try, Result and Fewer Tears
Exceptions are powerful for diagnostics but expensive in tight loops and high traffic code. This post explains what the runtime does when you throw, why that cost adds up, and when exceptions are the right tool. You will see small, runnable C# examples that model expected failures with Try, Result and tuples, plus a minimal API that returns HTTP results without throwing. We will also cover a micro tip for library authors to keep fast paths fast.
5 min0 likes0 comments ArticleStop Parallelizing Everything: A Practical Guide to Parallel.ForEach
Parallel.ForEach feels like a free speed boost, until it slows your app to a crawl. This post explains when parallel loops shine, when they backfire, and how to avoid the classic traps. You will see small runnable C# examples for CPU bound work, shared state pitfalls, and I/O scenarios. We will also cover safer async alternatives, thread local aggregation, and simple tuning with ParallelOptions. By the end, you will know how to pick the right approach and measure the impact with confidence.
4 min0 likes0 comments ArticleThe Traps of Nullable<T> in C#: a Practical Guide with Tiny Examples
Nullable<T> is not a mini reference type and pretending it is will bite you. This guide walks through how nullable value types work at runtime, how boxing really behaves, and what operator lifting does. You will see small, runnable C# snippets that expose common traps and safe patterns. Learn how to handle equality, pattern matching, and generics without surprises.
5 min0 likes0 comments ArticleStop Guessing Types in C#: typeof, GetType and IsAssignableFrom Explained
Let's break down the real jobs of typeof, object.GetType and Type.IsAssignableFrom with small, runnable examples and a few nerdy references for fun.
4 min0 likes0 comments ArticleC# 14's Unbound Generics in nameof Explained
C# 14 adds support for unbound generic types in nameof, so you can write nameof(Logger<>) and nameof(Dictionary<,>) without supplying throwaway type arguments. This post explains the syntax, shows practical examples for logs, exceptions, and attributes, and clarifies how nameof differs from typeof in this context.
3 min0 likes0 comments VideoThe Secret to Mastering Queue, Stack and Dictionary in C#!
EF Core soft deletes can be implemented with a nullable deletion timestamp, a save-changes interceptor, and global query filters.
13:3013,647 views521 likes VideoAsync Void in C#: The Trap Card You Keep Playing
The C# `init` accessor supports object initializers while preventing properties from being changed after initialization.
8:175,446 views281 likes ShortHow Pattern Matching Saves Your Day!
ASP.NET Core exception handling progresses from built-in middleware and custom middleware to modular .NET 8 `IExceptionHandler` implementations registered in priority order.
0:314,507 views57 likes VideoEasy LINQ Tips Every Developer Should Know!
Practical LINQ techniques improve performance and readability by avoiding repeated work, unnecessary allocations, unstable pagination, and accidental client-side processing.
13:4913,052 views629 likes ShortC# '== null': There's a Better Way!
The Peacock extension color-codes VS Code workspaces to distinguish projects, Live Share sessions, containers, WSL, and remote environments.
1:032,882 views109 likes ShortCan One Letter Break Your App!?
Parameterizing Entity Framework queries can let EF reuse a compiled query shape and help the database reuse its query plan.
0:354,756 views71 likes VideoStop Using == null: The Safer C# Pattern You Need Today!
C# inequality operators and `is not` pattern matching behave differently around constants, boxing, type checks, nulls, and overloaded operators.
11:4115,549 views580 likes ShortToLower is Killing your App Performance!
`Task.Wait` blocks its thread, while `await` releases that thread for other work until the operation completes.
0:431,851 views54 likes VideoStop Using ToLower() for Comparisons! The Fast, Correct Way in C#
14:2649,820 views1,803 likes VideoSupercharge Your WinForms Projects with .NET 9 Roslyn Analyzers
3:541,109 views31 likesYouTube ShortValue Types in C#
Using `var` can reduce repetition and simplify refactoring, but descriptive names and team-wide consistency matter more than personal preference.
0:541,414 views75 likes ShortReference Types in C#
C# reference types hold references to objects, so two variables can point to the same instance and observe the same changes.
1:001,170 views52 likes VideoThe Best C# Collections Explained
C# 12 expands aliases to tuples, pointers, arrays, and most other types, helping shorten repeated or complex declarations.
4:2215,847 views758 likes VideoC#: Class, Struct or Record - Which Should You Choose?
Classes, structs, records, and record structs are compared through reference versus value semantics, equality, mutability, and practical selection criteria.
7:5362,988 views2,742 likes ShortString or string in C#?
C# `string` is an alias for `System.String`, making the choice primarily a matter of style and team consistency.
0:552,147 views102 likes VideoShould You be Using the var Keyword in C#?
Choosing among `IEnumerable`, `ICollection`, `IList`, and `IQueryable` depends on whether data needs iteration, mutation, positional access, or remote query processing.
2:581,654 views77 likes VideoWhat is the Record Type in C#?
Returning `Task` instead of `async void` keeps asynchronous work observable, testable, awaitable, and able to propagate exceptions correctly.
4:2414,682 views543 likes VideoStop Using the var Keyword!
Explicit C# types can reduce the mental effort of understanding inferred variables, while target-typed constructor syntax offers a concise compromise.
2:426,439 views223 likes ShortStack vs. Heap in .NET
Git stash temporarily saves uncommitted changes, restores a clean working directory, and lets you reapply selected work later.
1:003,319 views147 likes VideoShould LINQ Be Banned from C#!?
Microsoft's AI Smart Components add clipboard-driven form filling, suggested combo-box options, and sentence autocomplete to .NET web interfaces.
3:201,519 views64 likes ShortImmutability in .NET just got a LOT easier
C# records provide value-based equality, concise declarations, useful printing, deconstruction, and immutable copying, while record structs offer value-type behavior.
0:56953 views41 likes VideoYou Should Probably Stop Using Task.Wait in C#
EF Core's `AsSplitQuery` avoids Cartesian explosion by loading sibling relationships with separate SQL queries and combining the results.
2:122,335 views64 likes VideoShould you await Inside Your C# Loops?
EF Core lazy loading can silently create N+1 database queries, while eager loading or targeted projections can retrieve data more efficiently.
3:283,867 views181 likes ShortHow to Create a Custom HttpClient Logger (2024)
A custom `IHttpClientLogger` can replace verbose default HTTP client logs with focused request, response, and failure information.
1:29829 views27 likes VideoAre People Wrong About .NET?
Common startup objections to .NET are challenged through its cross-platform support, open-source ecosystem, deployment flexibility, performance, and modern tooling.
2:571,340 views61 likes ShortHow has .NET not had this before!?
C# collection expressions simplify array and list creation, add spread syntax, and can support custom collection types through a builder attribute.
1:00458 views9 likes ShortBetter C# Anonymous Functions & Lambdas
A playful Blazor movie-trailer riff contrasts .NET web development with MVC, postbacks, state, JavaScript, and jQuery.
0:42476 views13 likes ArticleAlias any Type with C# 12
With C# 12, you can now alias type, including tuples, array, pointer, and unsafe types.
2 min0 likes0 comments ShortAlias Any Type in C# 12
C# pattern matching with `is null` and `is not null` avoids misleading results from overloaded equality operators.
1:56808 views30 likes ArticleUsing Primary Constructors in C# 12 & .NET 8
C# 12 provides a new way to use constructors that can potentially save you time, but there are several things to watch out for.
4 min0 likes0 comments VideoC# Has New Primary Constructors
CodeSnap creates customizable, theme-aware screenshots of selected code directly inside VS Code.
2:52774 views34 likes ArticleBuilding a Cross Platform NuGet Package
Learning to build a NuGet package by building a .NET SDK for the Deepgram API, while ensuring it's compatible with as many versions of the .NET Framework and as many platforms as possible.
5 min0 likes0 comments