NDepend

Improve your .NET code quality with NDepend

Code Smell – Primitive Obsession and Refactoring Recipes

Primitives are the real building blocks of your class and its use is obviously inevitable. But the real problem starts when they are not used properly. When you define Class,...
Patrick Smacchia December 1, 2020

Using C#9 record and init property in your .NET Framework 4.x, .NET Standard and .NET Core projects

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 that don’t require any change at...
Patrick Smacchia November 25, 2020

C# Index and Range Operators Explained

C#8 added the index ^ and range .. operators. In this post I am attempting to demystify both in the most comprehensive way. The index operator ^ Let’s start with...
Patrick Smacchia November 16, 2020

Visualize Code with Software Architecture Diagrams

The source code is the design. This famous motto means that no matter how many diagrams you draw and discuss with your colleagues, what matters is how the existing source...
Patrick Smacchia November 10, 2020

When your brain can’t handle the complexity: NDepend and PostSharp

The size and complexity of codebases have exploded in the last decade. What can you do when your codebase no longer fits your brain? In this article I’ll suggest two...
Patrick Smacchia November 2, 2020

Strategies to Catch Regression Bugs before Production: A Case Study

That’s quite a coincidence that a few days after promoting the joy of immutability in the post C#9 records: immutable classes we stumbled on a bug due to a mutable...
Patrick Smacchia October 19, 2020

C#9 records: immutable classes

Record is a long time awaited feature now proposed by C# 9. Finally we have a concise syntax to express this: [crayon-5fc64bb387f98924800707/] Isn’t it beautiful? In the NDepend code itself...
Patrick Smacchia October 12, 2020

New C#9 keywords ‘and’ ‘or’ ‘not’

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 match not keyword: Negative patterns. Require...
Patrick Smacchia October 5, 2020

.NET 5.0 App Trimming and Potential for Future Progress

In this article we will: go through the various ways to publish a .NET 5.0 application, play with .NET 5.0 app trimming to reduce the size of our deliverable use...
Patrick Smacchia September 28, 2020

Top 10 .NET 5.0 new APIs

When a new major .NET version hits Release Candidate, it is time to use the NDepend code review changes capabilities to browse which new APIs have been added. It is...
Patrick Smacchia September 21, 2020

Architecture of a C# game rendered with Blazor, Xamarin, UWP, WPF, and Winforms

When I wrote my last post Blazor Internals you need to know I came across this great project on github: AsteroidsWasm. This project is a remake in C# of the...
Patrick Smacchia September 15, 2020

Blazor Internals you need to know

Lately the Blazor technology received a lot of attention both from Microsoft and from the .NET community. Blazor is a UI technology. The ASP.NET team develops it since 2017. Its...
Patrick Smacchia September 3, 2020

14 Visual Studio Web Development Productivity Tips

Visual Studio proposes quite a few handy tools to boost your productivity as a web developer. Here are some tips focused around web code edition and web application starting and...
Patrick Smacchia July 28, 2020

10 Visual Studio Files and Layout Productivity Tips

Nowadays most developers are working remotely. Hence the monitor(s) configuration might have changed, and might change frequently. In this context, it does matter to optimize the Visual Studio layout and...
Patrick Smacchia July 21, 2020

10 Visual Studio Navigation Productivity Tips

A large code base is a complex asset. Visual Studio is a complex environment. In this context developers spend a significant part of their time searching and navigating across code...
Patrick Smacchia July 14, 2020

Top 10 Visual Studio Refactoring Tips

With the version 2019 Visual Studio is now mature when it comes to refactoring. This post proposes a tour of the top 10 most used refactoring actions in my opinion....
Patrick Smacchia July 7, 2020

12 Visual Studio Debugging Productivity Tips

In this post we assume the the reader knows the basics of debugging with Visual Studio: F5 to start running with the debugger F9 set breakpoint on the current line...
Patrick Smacchia June 30, 2020

10 Visual Studio Ninja Code Editor Productivity Tips

Among the multiple daily development tasks (planning, testing, refactoring, bug fix…) code edition is arguably the most satisfying one. Code edition can be even more satisfying and productive by mastering...
Patrick Smacchia June 24, 2020

10 Visual Studio Solution Explorer Productivity Tips

The Visual Studio Solution Explorer panel is like home for Visual Studio users. It presents all projects, source files and items thanks to a treeview layout. This panel is quite...
Patrick Smacchia June 17, 2020

Case Study : Complex UI Testing

In the previous post Case Study: 2 Simple Principles to achieve High Code Maintainability I explained that the principles layered code + high coverage ratio by test are 2 simple...
Patrick Smacchia April 29, 2020

Case Study: 2 Simple Principles to achieve High Code Maintainability

High Code Maintainability is the key to make both the management and the developers happy: Maintainability lets a product evolves naturally at a sustained pace with controlled cost. Maintainability lets...
Patrick Smacchia April 22, 2020

Advices to Become a Remote Programmer

With the actual COVID-19 worldwide outbreak many programmers are already forced to work remote, and we can expect that most of us will soon be home. In the IT and...
Patrick Smacchia March 10, 2020

Don’t rely on someone else to protect your software

This morning I stumbled on this post Decompilation of C# code made easy with Visual Studio on the Visual Studio blog. Basically VS will soon be able to not only...
Patrick Smacchia February 20, 2020

Mythical man month : 10 lines per developer day

The mythical book, Mythical man month quotes that no matter the programming language chosen, a professional developer will write on average 10 lines of code (LoC) day. After 14 years of...
Patrick Smacchia February 10, 2020

Not planning now to migrate your .NET 4.8 legacy, is certainly a mistake

2020 will see the achievement of the massive remodeling of the .NET platform initiated by Microsoft in November 2014 with the introduction of .NET Core 1, with the promise of...
Patrick Smacchia January 16, 2020

4 Predictions for the Future of .NET

In May 2019, Microsoft officially announced .NET 5, the future of .NET: it will be based on all the .NET Core work already achieved. Here is the schedule announced: On...
Patrick Smacchia October 8, 2019

.NET Core 3.0 New APIs

.NET Core 3.0 has just been released, see here the official announcement. In this post we’re going to explain how to list and explore the new APIs introduced since .NET...
Patrick Smacchia September 25, 2019

Find API Breaking Changes in your .NET Libraries and Frameworks

If you are developing a framework, the last thing you want to happen when releasing a new version of your product is to break the code of your clients because...
Patrick Smacchia September 24, 2019

Business Complexity vs. Implementation Complexity

It is good software design practice to make sure that methods can be entirely viewed in the code editor that typically shows 30 to 45 lines at a time. The...
Patrick Smacchia September 19, 2019

Answers to arguments against 100% coverage

I’ve been enthusiast about 100% coverage for more than a decade. The large code base of NDepend we are working on will reach soon 90% overall coverage. Most classes tested...
Patrick Smacchia September 10, 2019