NDepend Blog

Improve your .NET code quality with NDepend

C# Optional Parameters Explained

April 12, 2024 3 minutes read C# optional parameters allow methods, constructors, and indexers to be invoked without providing arguments for those optional parameters. This feature is particularly useful when...
NDepend April 12, 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

WPF vs WinForms – Making the Right Decision in 2024

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

C# Index and Range Operators Explained

December 11, 2023 3 minutes read In this post, we are demystifying both the C# index ^ and range .. operators most comprehensively. The index operator ^ Let’s start with...
NDepend December 11, 2023

Improve C# code performance with Span<T>

November 7, 2023 9 minutes read The structure Span<T> in the namespace System appeared with C# 7.2 in 2017. Span<T> offers type-safe access to a contiguous region of memory. Such...
NDepend November 7, 2023

C# Async Await Explained

November 2, 2023 9 minutes read In 2012 C#5 was released. This version introduced two new keywords async and await. At that time CPU clock speed reached an upper limit...
NDepend November 2, 2023

.NET 8 Top 10 New Features

October 23, 2023 7 minutes read .NET 8 will be officially release very soon in November 2023. Designated as an LTS (Long Term Support) version, it guarantees ongoing support, updates,...
NDepend October 23, 2023

Unveiling the Impressive Features of Upcoming C# 12

October 23, 2023 5 minutes read Microsoft unveils new features in C# 12 Preview. C# 12 along with .NET 8 will be officially released in November 2023. Let’s explore the...
NDepend October 23, 2023

Vertical Slice Architecture in ASP.NET Core

October 20, 2023 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 October 20, 2023

Clean Architecture in ASP.NET Core

October 20, 2023 9 minutes read The Clean Architecture approach has gained significant popularity for the design and development of software applications, emphasizing key principles such as maintainability, testability, and...
NDepend October 20, 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-66197134ad920555085580/] C#12 introduces primary constructor for...
NDepend April 13, 2023

.NET Build Improvement: Stop Wasting Resources

February 4, 2023 5 minutes read I am working on .NET development full-time since 2002 and there is a point that still annoys me after all these years: the default...
NDepend February 4, 2023

Deconstruction in C#

January 18, 2023 2 minutes read C# 7.0 introduced the deconstruction syntax. It allows developers to extract in a single expression, properties of an object or elements of a tuple...
NDepend January 18, 2023

The new .NET 7.0 IParsable<TSelf> interface

November 21, 2022 3 minutes read As I explained in the post C# 11 static abstract members, C# 11 let’s write static abstract members in interface. This feature was mostly...
NDepend November 21, 2022

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

C# 11 File Scoped Types

October 27, 2022 4 minutes read C#11 added the file scoped types feature: a new file modifier that can be applied to any type definition to restrict its usage to...
NDepend October 27, 2022

Managed pointers, Span, ref struct, C#11 ref fields and the scoped keyword

October 25, 2022 9 minutes read The concept of managed pointer exists in the NET runtime and C# since the inception of the platform in the early 2000. Managed pointers...
NDepend October 25, 2022

C# 11 Raw String Literals Explained

August 25, 2022 3 minutes read C# 11 introduces Raw String Literals. Undoubtedly this feature will become very popular because it represents an elegant way to solve some issues with...
NDepend August 25, 2022

C# 11 static abstract members

June 14, 2022 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 June 14, 2022

C# Binary Search: Fast find of a free slot between 0 and uint.MaxValue

January 3, 2022 2 minutes read When a user is exporting a result to a document with NDepend, the tool needs to find a file name not taken in the...
NDepend January 3, 2022

Modern C# Hello World

November 23, 2021 6 minutes read With Visual Studio 2022 when you create a new console project based on .NET 6, the Hello World source code generated is now as...
NDepend November 23, 2021

Top 10 New .NET 6.0 API

July 7, 2021 4 minutes read .NET 6 introduces new handy APIs that will make our development journey easier. Let’s go through the top 10 new API in terms of...
NDepend July 7, 2021

How to Logically Name Embedded Resources in .csproj?

June 16, 2021 1 minutes read You can work with .NET for two decades and still discover some useful stuff.  One thing that bothered me till now is that an...
NDepend June 16, 2021

Migrating Delegate.BeginInvoke Calls to .NET Core, .NET 5 and .NET 6

May 26, 2021 3 minutes read In this 2019 post, the .NET Base Class Library engineers announced that the good old Delegate.BeginInvoke .NET Framework syntax wasn’t supported in .NET Core...
NDepend May 26, 2021

Covariance and Contravariance in C# Explained

May 4, 2021 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 4, 2021

Clean Architecture Refactoring: A Case Study

April 27, 2021 9 minutes read Introduction to Clean Architecture The recent post Clean Architecture for ASP.NET Core Solution: A Case Study explained that one of the most interesting property...
NDepend April 27, 2021

Hungarian Notation for Fields in C#

April 21, 2021 6 minutes read If there is one topic that divides the C# developers community, it is the Hungarian notation for fields. In our team we rely on...
NDepend April 21, 2021