NDepend

Improve your .NET code quality with NDepend

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...
Patrick Smacchia February 23, 2021

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...
Patrick Smacchia February 9, 2021

Include IL Offset into Production Exception Stack Traces

In a previous post The proper usages of Exceptions in C# I explained that it is important to get as much information as possible from production crash logs. One such...
Patrick Smacchia February 2, 2021

Is Artificial Intelligence Assisted Coding the Next Developer Productivity Silver Bullet?

The famous Fred Brooks paper “No Silver Bullet – Essence and Accident in Software Engineering“ published in 1987 stated that: “there is no single development, in either technology or management technique,...
Patrick Smacchia January 26, 2021

Visual Studio IntelliCode : AI Assisted Coding

We are all amazed by recent progresses made possible thanks to Artificial Intelligence (AI). In 2017 Microsoft announced Visual Studio IntelliCode which used Machine Learning (ML) to predict code completions,...
Patrick Smacchia January 19, 2021

How we quickly refactored with Resharper more than 23.000 calls to Debug.Assert() into more meaningful assertions

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 assertions calls. Few developers realize that...
Patrick Smacchia January 11, 2021

The proper usages of Exceptions in C#

The C# exception basics are generally well understood. However exceptions are often used as a way to sweep error handling duty under the carpet. As I did in The proper...
Patrick Smacchia December 16, 2020

The proper usages of the keyword ‘static’ in C#

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 came up after 25 years of...
Patrick Smacchia December 8, 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

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

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

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

SOLID Design: The Interface Segregation Principle (ISP)

After having covered The Open-Close Principle (OCP), The Liskov Substitution Principle (LSP) and the Single Responsibility Principle (SRP) let’s talk about the Interface Segregation Principle (ISP) which is the I...
Patrick Smacchia August 20, 2019

SOLID Design: The Open-Close Principle (OCP)

The Open-Close principle (OCP) is the O in the well known SOLID acronym. Bertrand Meyer is generally credited for having originated the term open/closed principle, which appeared in his 1988...
Patrick Smacchia July 30, 2019

SOLID design: The Liskov Substitution Principle (LSP)

The Liskov substitution principle is the L in the well known SOLID acronym. The original principle definition is: Methods that use references to base classes must be able to use...
Patrick Smacchia July 23, 2019

Service Oriented Architecture: A Dead Simple Explanation

Service-oriented architecture (SOA) has been with us for a long time. The term first appeared in 1998, and since then it’s grown in popularity. It’s also branched into several variants,...
Eric Goebelbecker January 8, 2019

C# Features: An Exhaustive List of the Best Ones

The first post I wrote for the NDepend blog was about C# 8.0 features. That post inspired a sequel, followed by the series’ final chapter. Those posts dealt with the...
Carlos Schults December 18, 2018

REST vs. RESTful: The Difference and Why the Difference Doesn’t Matter

What’s the difference between a REST API and a RESTful one? Is there a difference? This sounds like the kind of academic question that belongs on Reddit. But then you...
Eric Goebelbecker December 11, 2018

Coupling in Programming: What This Means and How Not to Get Burned

What is coupling in programming? Is it something we want to avoid when we design and write code? If so, why? And more importantly, how? Let’s take a look at...
Eric Goebelbecker December 4, 2018

Mentoring Software Developers as an Architect

A while back we discussed the unique career path architects have to travel. We wrote that article for developers who want to advance their careers and aren’t sure which way...
Eric Goebelbecker November 27, 2018

Self Documenting Code vs. Comments? Turns Out It’s Both or Neither

It’s been about a month since my last research post, and I’ve been musing about the next topic.  What should it be?  Well, I’ve decided.  Since I love nothing more...
Erik Dietrich November 20, 2018

Visual Studio Enterprise vs. Professional: Essential Differences

If you’re a .NET developer, then it’s overwhelmingly likely that you’re a Visual Studio user. There are alternatives to it, sure. But the product from the Redmond giant is the...
Carlos Schults November 13, 2018

Should Architects Write Code? You Bet They Should!

There’s a common misconception that’s permeated our profession: Architects don’t need to write code to do their jobs. Now, this may seem like a harmless approach. After all, writing code...
Sylvia Fronczak October 30, 2018

When Is It Okay to Use a C# Partial Class?

Today’s post attempts to answer a very simple and straightforward question: “When is it OK to use a C# partial class?” And the answer as straightforward as this: “When you need...
Carlos Schults October 16, 2018

Extension Methods and the Decline of Traditional OOP

A bunch of years ago, I wrote a post on my own personal blog titled, “Why I Don’t Like C# Extension Methods.”  Over the years, I’ve updated that post a...
Erik Dietrich October 9, 2018

Linq Tutorial: A Complete Beginner’s Gentle Introduction

There was a time when Linq was a mystery to me. But, now that I’ve learned how to use it, I don’t know how I ever lived without it! You’ll...
Phil Vuollet September 18, 2018

Programming to an Interface: A Simple Explanation

As an architect, you know that programming to an interface is good. It’s what everyone should do. But what does that mean? And why should you do it? Searching the...
Sylvia Fronczak August 21, 2018

What Is a Good Unit Test? 5 Must-Haves

In this day and age, unit testing isn’t as controversial as it once was. Sure, you still see the occasional inflammatory, clickbait-y, confrontational “unit testing is garbage” type of post...
Carlos Schults August 14, 2018

Declarative Programming in Depth

Most people that start programming learn to program in an imperative way. Shortly after, they will probably learn a declarative language too. Many developers go a long way without knowing...
Peter Morlion July 3, 2018