Regions in C#

by Apr 11, 2023

Regions in C# is an anti-pattern or code smell.

When I review, I sometimes see a class that looks decent. Then I open the #region sections and it becomes a big giant monster.

If you think code should be in a #region because it’s a separate step or thing, it should be a method.

Please, don’t hide code with a #region.

Subscribe to
The Daily Friction

A daily newsletter on automation and eliminating friction

Related Content

Scrum conceals bad teams.

Scrum conceals bad teams. Far too often, we confuse Scrum with a magic wand that transforms any team into a high-performing 'dream team'. It's tempting to believe that the sprint system, with its regular completion and initiation of tasks, gives us an agile and...

read more

🚀 Process Automations in Microsoft Loop!

🚀 Process Automations in Microsoft Loop! Now you can create Power Automate-backed rules to streamline repetitive tasks in your Loop table. See https://insider.microsoft365.com/en-us/blog/streamline-your-workflow-with-automation-in-microsoft-loop Loop is slowly...

read more

You don’t control the truth in Production!

You don't control the truth in Production! Now a days multiple teams/projects are working on the same Dataverse production environment. So thinking you can manage the complete production truth in your ALM pipeline is strange. Not every environment is 💯 equal to...

read more
Share This