NDepend Blog

Improve your .NET code quality with NDepend

C# Array and List Fastest Loop in 2024

June 12, 2024 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 June 12, 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

The .NET 7.0 IParsable<TSelf> interface

May 7, 2024 3 minutes read As I explained in the post C# 11 static abstract members, C# 11 let’s write static abstract members in an interface. This feature was...
NDepend May 7, 2024

C# Discriminated Union: What’s Driving the C# Community’s Inquiries?

May 6, 2024 6 minutes read In recent years, there has been a notable surge in inquiries from the C# community regarding language-level support for C# Discriminated Unions. What individuals...
NDepend May 6, 2024

Covariance and Contravariance in C# Explained

May 2, 2024 6 minutes read Introduction Covariance and contravariance allow more flexibility when dealing with C# class hierarchy. This article explains and demonstrates the concepts of Covariance and Contravariance...
NDepend May 2, 2024

C# DateTime Format In A Nutshell

April 29, 2024 6 minutes read This article is about C# DateTime Format, which means both: Use a pattern like "yyyy-MM-dd HH:mm:ss" to extract and format the year, month, day,...
NDepend April 29, 2024

In the Jungle of .NET Obfuscator Tools

April 26, 2024 7 minutes read In this article, I will explain our genuine experience with various .NET Obfuscator Tools. We end up explaining that .NET Reactor is the one...
NDepend April 26, 2024

Vertical Slice Architecture in ASP.NET Core

April 26, 2024 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 April 26, 2024

C# 12 New Features

April 26, 2024 5 minutes read C# 12 along with .NET 8 has been officially released in November 2023. Let’s explore C# 12 New Features in this post. Primary Constructors...
NDepend April 26, 2024

Improve C# code performance with Span<T>

April 24, 2024 9 minutes read Welcome to our exploration of System.Span<T> and System.ReadOnlySpan<T>, two powerful structures introduced in C# 7.2 back in 2017. As a type-safe way to access...
NDepend April 24, 2024

.NET 8 Top 10 New Features

April 24, 2024 7 minutes read .NET 8 has been officially released in November 2023. You can download it here. Designated as an LTS (Long Term Support) version, it guarantees...
NDepend April 24, 2024

WPF vs WinForms – Making the Right Decision in 2024

April 24, 2024 7 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 April 24, 2024

Will Visual Studio Be Migrated to .NET Core and Become Multi-Platform?

April 22, 2024 7 minutes read I came across comments on a recent Reddit post and thought it would be intriguing to analyze the DLLs of Visual Studio 2022 (version...
NDepend April 22, 2024

C# String Interpolation Explained

April 17, 2024 3 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 April 17, 2024

Clean Architecture in ASP.NET Core

April 16, 2024 9 minutes read The Clean Architecture pattern has gained significant popularity for the design and development of software applications. It emphasizes key principles to better maintain, scale,...
NDepend April 16, 2024

C# Async Await Explained

April 16, 2024 9 minutes read If your application involves I/O-bound operations like network requests, database access, or file system reads and writes, asynchronous programming is essential. Similarly, for CPU-bound...
NDepend April 16, 2024

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

April 15, 2024 8 minutes read In the world of .NET development, two popular tools stand out: Visual Studio and Visual Studio Code. Visual Studio is generally recognized as a...
NDepend April 15, 2024

Class vs Struct in C#: Making Informed Choices

April 15, 2024 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. This article presents...
NDepend April 15, 2024

C# Pattern Matching Explained

April 11, 2024 7 minutes read   Since the C# version 7, C# has support for pattern matching. C# pattern matching is here to simplify complex if-else statements into more...
NDepend April 11, 2024

Architecture of a .NET Application: 8 Case Studies

January 30, 2024 9 minutes read This recent question on Reddit’s Number of projects per solution led to interesting debates. Of course, the answer depends largely on the overall size...
NDepend January 30, 2024

C# Record Explained

January 23, 2024 7 minutes read A C# record is a data-centric type that usually doesn’t contain behaviors.  C# 9 introduced the keyword record to quickly declare a class primarily...
NDepend January 23, 2024

C# ValueTuple Full Guide

January 18, 2024 9 minutes read In 2017 C# 7.0 introduced ValueTuple. This feature makes it convenient to handle lightweight data structures. Here is an example of relying on the...
NDepend January 18, 2024

.NET – 7 Decompiler Compared (2024)

January 10, 2024 9 minutes read Looking to reverse engineer or disassemble some .NET code? Then learning how to decompile .NET assemblies is an essential skill for any .NET developer...
NDepend January 10, 2024

Improve Visual Studio Build Performance

August 11, 2023 7 minutes read Time is your most precious asset and slow build is high in the list of developer’s productivity killers. With slow build the penalty is...
NDepend August 11, 2023

Improved .NET Debugging Experience with Source Link

June 20, 2023 3 minutes read Source Link is a Microsoft technology that lets .NET developers debug the source code of NuGet packages referenced by their applications. I underlined source...
NDepend June 20, 2023

.NET Micro-Optimization and Refactoring Trick

May 31, 2023 3 minutes read Recently, I made an interesting observation regarding Dictionary<string,T>: the method TryGetValue() is faster when building  with new Dictionary<string,T>(StringComparer.Ordinal). This performance difference can be attributed...
NDepend May 31, 2023

C#12 class and struct Primary Constructors

April 13, 2023 3 minutes read Since C#9 we have the convenient primary constructor syntax for class record (or just record) and struct record: [crayon-666aac8726786593154086/] C#12 introduces primary constructor for...
NDepend April 13, 2023

C# 11 required members

November 15, 2022 3 minutes read C# 11 proposes the new keyword required that can apply to an instance property or an instance field declaration within a class, a record...
NDepend November 15, 2022