Naming of your methods

by Apr 10, 2023

Good naming of your methods can solve a lot of customer issues.

I use NServiceBus as messaging framework in dotnet. I was using a method of this framework, which wasn’t doing what I was expected.

NServiceBus uses a UnitOfWork pattern when sending messages. I was using the method RequireImmediateDispatch(), This flags NServiceBus to dispatch messages immediate, instead of sending them at the end of the UnitOfWork.

Apparently, there is also a method to check if this flag is set. This method is called RequiredImmediateDispatch(). Did you see the problem?

I didn’t. It is only different by one letter.

I used the wrong one in my code and that resulted in strange behavior that I couldn’t explain.

In NServiceBus 8 this method is now renamed to IsImmediateDispatchSet() which hopfully prevents my mistake happing to other users.

Subscribe to
The Daily Friction

A daily newsletter on automation and eliminating friction

Related Content

SpecFlow: Great concept, flawed execution.

SpecFlow: Great concept, flawed execution. SpecFlow, a BDD framework designed to make writing scenarios a breeze for requirement analysts. The problem: It falls short of its promise. ❌ The reality? Analysts rarely, if ever, write the specs themselves. Instead,...

read more

What if…? Production has a Staging slot.

What if...? Production has a Staging slot. Staging or QA environment needs to be the same or as close to production as it can be. Preferably, you want to restore a recent backup 💾 from Production as Staging and then deploy your changes 🔄. Kudos 👏 if you've fully...

read more

UUID v7 coming in .NET 9

UUID v7 coming in .NET 9 For those that didn't know, you can create Guids in different ways (algorithms). System.Guid supports UUID v4 out-of-the-box, the most used version. UUID v7 is now added, which creates Guids based on the current time. This means Guids can be...

read more