Dennis Doomen

@dennisdoomen.com

Microsoft MVP | Coding Architect | .NET Tech Lead | .NET & C# | TypeScript | Fluent Assertions Author | International Speaker | Occasional Trainer | React & VueJS | Event Sourcing Veteran | DDD Designer | TDD Practitioner | Clean Code Writer

During the weekend, I've released Mockly 1.11, the new in-memory HTTP mocking library in town. This version allows you to simulate delayed responses or requests that throw exceptions. Check out the docs at mockly.org

BildBild

We released Fallout 10.4—the first new version since Nuke was abandoned. Fallout replaces messy YAML pipelines with refactorable, debuggable, navigable C#. • Inspired by Make • Makes Azure DevOps → GitHub Actions migration easier • Used in my OSS & client projects

Bild

An interface with one method is often just a named function signature. If it is not likely to grow, a delegate is simpler, more loosely coupled, and easier to test.

Bild

Choosing between records and classes in C# matters! Records: data-focused, immutable, structural equality (DTOs, value objects) Classes: behavior-focused, mutable state, identity-based Record struct: small immutable values (stack allocation) Mix them and you've got a design problem. #CSharp

Bild

In general, if you find a lot of data-only classes in your code base, you probably also have a few (static) classes with a lot of behavior. Use the principles of object-orientation explained and move the logic close to the data it applies to. ⚠️The only exceptions to this rule are classes...

Bild

If you find yourself writing code like this someObject.SomeProperty.GetChild().Foo() ...then you may be violating the Law of Demeter. An object should not expose other classes it depends on, because callers may misuse that exposed property or method to access the object behind it...

Bild

In other words, you should be able to pass an instance of a derived class wherever its base class is expected, without the callee knowing the derived class. A very notorious example of a violation of this rule is throwing a NotImplementedException when overriding methods from a base...

Bild

Did you know there's a great way to start building an (open-source) library in .NET that comes with everything you'd expect from a professional package? And did you know it supports GitHub and Azure DevOps? If not, check out github.com/dennisdoomen.... Version 1.9 was released over the weekend.

Bild

Interfaces should have a name that clearly explains their purpose or role in the system. Do not combine many vaguely related members on the same interface just because they were all on the same class. Separate the members based on the responsibility of those members, so that callers only need...

Bild

If a constructor dependency is only used by a single method, ask whether it belongs there at all. Passing it as a method parameter often produces a cleaner API and keeps the constructor focused on what the object actually needs.

Bild

A class should do one thing well. It can model a primitive value like EmailAddress or ISBN, represent a business concept, hold plain data, or coordinate other classes. It should not do a mix of those. Good SRP warning signs: ❌And in the name ❌Hard to name or explain ⬇️

Bild

Using AI tools to generate, suggest or refactor code is fine, but you are fully responsible for every line that ends up in the codebase. Do not merge AI-generated code without reviewing it, understanding it and verifying that it meets the same quality bar as hand-written code.

Bild

Today, I'll drive to one of my favorite conferences in Germany, the wonderful Developer World - DWX. This year is going to be quite busy. I won't just do one, not two, but three different talks, all new and shiny. Can't wait to immerse myself in the Germany hospitality. Will I see you there?

Bild

YAGNI isn't about avoiding change. It's about avoiding premature complexity. Don't add abstraction layers, extension points, or configuration options for requirements that don't exist yet. Build for today's needs. Refactor when tomorrow arrives.

Bild

Next week, I'll drive to one of my favorite conferences in Germany, the wonderful DWX Developer Week. This year is going to be quite busy with three different talks, all new and shiny. Can't wait to immerse myself in the Germany hospitality. Will I see you there?

Bild

The simplest solution that fully solves the problem is usually best. Complexity makes code harder to read, test, debug and change. Avoid over-engineering, unnecessary abstraction, or clever tricks. If a junior dev can't grasp in one pass, it's too complex. Simplicity is a feature.

Bild