WPF / Winforms UI Refactoring: A Case Study
WPF and Winforms are still so massively used that Microsoft fully supports those technologies in .NET Core, .NET 5, 6 , 7 and so on. However WPF and Winforms are...
C# async await explained
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 imposed by physical laws. But chip...
C# Pattern Matching Explained
Since the C# version 7, C# has support for pattern matching. C# pattern matching is here to simplify complex if-else statements into more compact and readable code. Pattern matching does...
Improve C# code performance with Span<T>
C# 7.2 introduced the structure System.Span<T>. First we’ll present a concrete example where Span<T> helps achieve better performance. Then we’ll explain what makes Span<T> so special. Span<T> primary goal is...
Improve Visual Studio Build Performance
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 twofold: not only the time taken...
How to collect return values from Parallel.ForEach?
Today I took 10 minutes to answer the 9 years old stackoverflow’s question: How do I collect return values from Parallel.ForEach? I though the improved solution deserved a quick blog...
C# Binary Search: Fast find of a free slot between 0 and uint.MaxValue
When a user is exporting a result to a document with NDepend, the tool needs to find a file name not taken in the temporary dir. Generating a GUID for...
Modern C# Hello World
With Visual Studio 2022 when you create a new console project based on .NET 6, the Hello World source code generated is now as simple as that: [crayon-628ab33bab792234965473/] Nice and...
In the Jungle of .NET Decompilers
C#, VB.NET and F# code gets compiled to IL code. IL stands for Intermediate Language. IL code is intermediate in the sense it sits between high level language like C#...
Solution to Visual Studio 2022 messing up Visual Studio 2019
As all .NET developers I am quite excited by Visual Studio 2022 and .NET 6 going RTM. However I noticed that Visual Studio 2022 RTM install messed up Visual Studio...
5x Lessons Learned from Migrating a Large Legacy to .NET 5/6
In January 2020 I wrote the post Not planning now to migrate your .NET 4.8 legacy, is certainly a mistake. Hopefully we followed our own advice and have been migrated...
Debugging a .NET App on Linux from Windows Visual Studio with WSL
NDepend analysis, reporting, API and Power-Tools will run on Linux and MacOS with the next version 2021.2. To achieve that, a major refactoring session has been achieved to isolate code...
Code Testability: A Case Study
[crayon-628ab33bae0d9234990627/] This method is untestable because its logic depends on NdpOperatingSystem.Kind which returns an OSPlatform object. Notice the usage of the attribute UncoverableByTest that lets code reviewers and tools like...
3 productivity Resharper features missing in Visual Studio
Resharper is a great Visual Studio productivity extension but on the other hand it slows down significantly the IDE, especially when working with large solutions. However there are real hopes...
What is Code Review? – Guidelines and Best Practices
Code review is the process of mandating systematically one or several developers to review the code written by another developer in other to detects defect and to improve it. Code...
Top 10 New .NET 6.0 API
.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 usage likelyhood. Then in the conclusion,...
How to Logically Name Embedded Resources in .csproj?
You can work with .NET for two decades and still discover some useful stuff. One thing that bothered me till now is that an embedded resource name is “the project...
In the Jungle of .NET Obfuscator Tools
In this article I will explain our genuine experience with various .NET Obfuscator Tools. We end up explaining that .NET Reactor is the one we choose to obfuscate our code...
Migrating Delegate.BeginInvoke Calls to .NET Core, .NET 5 and .NET 6
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 and consequently in .NET 5, 6...
On replacing Thread.Abort() in .NET 6, .NET 5 and .NET Core
Thread.Abort() is not supported in .NET 5 / .NET Core We are actually migrating the NDepend analysis and reporting to .NET 5 and figured out that there is no equivalent...
Visual Studio 2022 64 bits: Elements of history
Finally after all these years of waiting Visual Studio 2022 will run in a 64 bits process on 64 bits machines! As a consequence the effective process address space of the...
Covariance and Contravariance in C# Explained
Introduction This article explains and demonstrates the concepts of Covariance and Contravariance in C# .NET. These concepts will be first introduced for generics, then for delegates and finally for arrays....
Clean Architecture Refactoring: A Case Study
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 promoted by Clean Architecture is the...
Hungarian Notation for Fields in C#
If there is one topic that divides the C# developers community, it is the Hungarian notation for fields. In our team we rely on Hungarian notation for fields, not just...
6 Reasons Visual Studio Theme Affects Productivity
Themes can be fascinating. Humans are vulnerable to attachments. It could be anything – person, thing, color, food, etc. some people are attracted to unique colors that make them feel...
Implementing a Domain with POCO (Plain Old CLR Objects)
Here is a remark I noticed on my recent post Clean Architecture for ASP.NET Core Solution: A Case Study and I’d like to detail a bit this here: “The article...
8 Books to Improve as a .NET Developer
Nowadays all information a developer needs to know is available online for free. Blogposts and videos authored by experts, giant questions and answers websites, a quick search and you get...
Clean Architecture for ASP.NET Core Solution: A Case Study
In this post I’ll explore the Jason Taylor’s CleanArchitecture .NET solution template available here on github. It constitutes a good template and it is based on several modern industry wide...
How to Plan Large-Scale Refactoring?
The .NET platform exists for two decades and nowadays the technology is evolving faster than ever. It is now time for serious .NET applications to be refactored to run...
10 Reasons Why You Should Write Tests
As many, I started programming when I was a child 3 decades years ago. With no doubt, the most important practice I’ve adopted during my professional career is to write...