Category: C#
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...
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...
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...
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...
.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...
Deconstruction in C#
April 24, 2024 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...
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...
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...
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-688d84ea35941835551495/] C#12 introduces primary constructor for...
.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...
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...
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...
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...
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...
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...
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...
Top 10 New .NET 6.0 API
July 7, 2021 5 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...
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...
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...
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...
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...
8 Books to Improve as a .NET Developer
March 31, 2021 4 minutes read Nowadays all information a developer needs to know is available online for free. Blogposts and videos authored by experts, giant questions and answers websites,...
How we quickly refactored with Resharper more than 23.000 calls to Debug.Assert() into more meaningful assertions
January 11, 2021 6 minutes read Since the NDepend inception more than 15 years ago, we stuffed our code with calls to Debug.Assert(). This results today in more than 23.000...
The proper usages of Exceptions in C#
December 16, 2020 9 minutes read The C# exception basics are generally well understood. However exceptions are often used as a way to sweep error handling duty under the carpet....
The proper usages of the keyword ‘static’ in C#
December 8, 2020 6 minutes read The keyword static is somewhat awkward in a pure Oriented-Object world. I would like to explain here what are the right usages of static I...
Using C#9 record and init property in your .NET Framework 4.x, .NET Standard and .NET Core projects
November 25, 2020 2 minutes read C#9 record and C#9 init property are really nice addition to the language. As explained in C#9 records: immutable classes, both are syntactic sugar...
C#9 records: immutable classes
October 12, 2020 8 minutes read Record is a long time awaited feature now proposed by C# 9. With record we have a concise syntax to define immutable types this...
New C#9 keywords ‘and’ ‘or’ ‘not’
October 5, 2020 4 minutes read HoweverThe C#9 language introduces new controversial keywords: and keyword: Conjunctive patterns. Require both patterns to match or keyword: Disjunctive patterns. Require either pattern to...