NDepend Blog

Improve your .NET code quality with NDepend

C# ValueTuple Full Guide

July 28, 2025 8 minutes read C# 7.0 introduced ValueTuple in 2017, making it easier to work with lightweight data structures.Here’s an example using ValueTuple with the () syntax to...
NDepend July 28, 2025

C# Async/Await Explained: Complete Guide with Examples [2025]

July 14, 2025 9 minutes read Mastering async / await in C# is key to building fast, scalable .NET apps. Introduced in C# 5 in 2012, these keywords transformed how...
NDepend July 14, 2025

Architecture of a .NET Application: 8 Case Studies

July 10, 2025 8 minutes read This recent question on Reddit’s Number of projects per solution led to interesting debates. The answer depends on the app’s size and domain. In...
NDepend July 10, 2025

Clean Architecture in ASP.NET Core

July 7, 2025 9 minutes read As applications scale, flexibility and maintainability become essential. .NET Core Clean Architecture provides a clear structure with minimal dependencies, making it a popular choice....
NDepend July 7, 2025

C# Pattern Matching Explained (2025)

June 17, 2025 7 minutes read   Pattern matching in C# involves assessing an expression to see if it fits one or several particular condition—like checking if it’s of a...
NDepend June 17, 2025

C# DateTime Format In A Nutshell

June 16, 2025 7 minutes read This article covers C# DateTime Format, addressing both of its main aspects: Obtain a date-formatted string. Use a pattern like "yyyy-MM-dd HH:mm:ss" to extract and...
NDepend June 16, 2025

Vertical Slice Architecture in ASP.NET Core

June 10, 2025 6 minutes read The organization of code in a solution is a subject of frequent debates. Currently, two prominent approaches have garnered attention: Clean Architecture versus Vertical...
NDepend June 10, 2025

Visual Studio vs Visual Studio Code: The Ultimate Guide (2025)

June 1, 2025 8 minutes read Despite their similar name, Visual Studio and Visual Studio Code are two distinct products created by Microsoft. Visual Studio is a full-featured Integrated Development...
NDepend June 1, 2025

C# Index and Range Operators Explained

May 24, 2025 3 minutes read In this post, we comprehensively demystify the C# index ^ and range .. operators. The index operator ^ Let’s start with the index ^...
NDepend May 24, 2025

C# String Interpolation Explained

May 14, 2025 4 minutes read C# String Interpolation is a powerful feature that simplifies the syntax for embedding variables and expressions within strings to construct strings dynamically. String interpolation...
NDepend May 14, 2025

WPF vs WinForms – Making the Right Decision in 2025

May 12, 2025 8 minutes read If you’re a developer faced with the decision of selecting between Windows Presentation Foundation (WPF) and Windows Forms (WinForms) commonly referred to as WPF...
NDepend May 12, 2025

Class vs Struct in C#: Making Informed Choices

May 11, 2025 9 minutes read In C# programming, choosing the right data type between classes and structs is a crucial decision that impacts application performance and design. Choosing Between Struct...
NDepend May 11, 2025

Improve C# code performance with Span<T>

March 24, 2025 9 minutes read Welcome to our deep dive into System.Span<T> and System.ReadOnlySpan<T>. Introduced in C# 7.2 (2017) and supported by the .NET Core runtime, these powerful structures...
NDepend March 24, 2025

C# Optional Parameters Explained

March 18, 2025 3 minutes read C# optional parameters enable methods, constructors, indexers and delegates to be called without specifying all arguments. This simplifies method calls and improves readability by...
NDepend March 18, 2025

.slnx The New .NET Solution XML File Format

March 17, 2025 3 minutes read On March 13th, 2025 Microsoft officially announced the a new .NET solution file format with file extension .slnx. For example for this simple solution:...
NDepend March 17, 2025

C# Array and List Fastest Loop in 2025

January 9, 2025 5 minutes read Discussions about the fastest way to loop through an array (T[]) and a List<T> in C# have been ongoing. Results can vary with each...
NDepend January 9, 2025

The attribute OverloadResolutionPriority in .NET 9 and C# 13

December 12, 2024 2 minutes read With .NET 9, we gain a new tool for managing method overloads: OverloadResolutionPriorityAttribute declared in the namespace System.Runtime.CompilerServices. It lets you set an overload’s...
NDepend December 12, 2024

C# 13 params collections

December 3, 2024 3 minutes read Here is a quick post to explain how the upcoming C# 13 params collections feature frees your code from many allocations. C# params prior...
NDepend December 3, 2024

.NET 9.0 LINQ Performance Improvements

November 19, 2024 5 minutes read NET 9.0 brings significant improvements to LINQ performance, with some scenarios showing remarkable gains. Let’s take a closer look at what’s driving these enhancements....
NDepend November 19, 2024

Alternate Lookup for Dictionary and HashSet in .NET 9

November 18, 2024 3 minutes read In .NET 9, a new method called GetAlternateLookup<TKey, TValue, TAlternate>() has been introduced for hash tables classes, including Dictionary<TKey, TValue>, HashSet<T>, ConcurrentDictionary<TKey, TValue>, FrozenDictionary<TKey,...
NDepend November 18, 2024

Why Is Counting Lines of Code (LOC) Useful?

November 7, 2024 2 minutes read In the previous post How do you count your number of Lines Of Code (LOC) ?, we explained how to count the LOC of...
NDepend November 7, 2024

How do you count your number of Lines Of Code (LOC) ?

November 6, 2024 2 minutes read Counting Lines of Code (LOC) is not as straightforward as it seems. Developers often wonder: Should method signature declarations count? What about lines with...
NDepend November 6, 2024

The problem with frameworks

October 31, 2024 3 minutes read I just watched this short 2:39 video from Uncle Bob, and it rang a bell. His books inspired me two decades ago to create...
NDepend October 31, 2024

Find C# Code Duplicate

October 22, 2024 3 minutes read Duplicate code copy-pasted is problematic. It increases maintenance efforts and the risk of inconsistencies. Changes made in one instance may not be reflected in...
NDepend October 22, 2024

Fastest C# Enum to String

July 15, 2024 3 minutes read This article benchmarks various ways to obtain a string from an enumeration value in C# .NET, along with other common enumeration APIs. At NDepend,...
NDepend July 15, 2024

Readonly, Immutable, and Frozen Collections in .NET

July 1, 2024 4 minutes read In modern software development, immutability is a powerful concept. The .NET Base Class Library (BCL) offers readonly, immutable, and frozen collections. This terminology might...
NDepend July 1, 2024

When to create a new .csproj?

June 24, 2024 5 minutes read Recently, a question has been raised on Reddit/r/dotnet: When should you create a new .csproj? This is a crucial consideration for every .NET team....
NDepend June 24, 2024

Top 10 C# Recent Improvements

June 3, 2024 7 minutes read Over the years, in collaboration with the community, the C# team has introduced numerous impressive new syntax features. Some of these simplify coding and...
NDepend June 3, 2024

The .NET Generic Math Library

May 15, 2024 7 minutes read In November 2022 with the release of .NET 7, new math-related generic interfaces have been added to the .NET Base Class Library (BCL). This...
NDepend May 15, 2024

C# static abstract members

May 14, 2024 5 minutes read C# 11 proposed interface members declared as static abstract. This is useful to handle both: Polymorphism at the type level, for example when abstracting...
NDepend May 14, 2024