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.

Remy van Duijkeren

Remy van Duijkeren

Power Platform Advisor

Microsoft Power Platform Advisor with over 25 years of experience in IT with a focus on (marketing) automation and integration.

Helping organizations with scaling their business by automating processes on the Power Platform (Dynamics 365).

Expert in Power Platform, Dynamics 365 (Marketing & Sales) and Azure Integration Services. Giving advice and strategy consultancy.

Services:
– Strategy and tactics advise
– Automating and integrating

Subscribe to
The Daily Friction

A daily newsletter on automation and eliminating friction

Related Content

Converting to ConvertKit!

Converting to ConvertKit! I wouldn't recommend this to everyone, but... migrating to ConvertKit has transformed my email marketing game. Here's why I've made the switch from ActiveCampaign: βœ… Modern sleek interface: It's intuitive and easy on the eyes. No more...

read more

Ditching ActiveCampaign!

Ditching ActiveCampaign! I remember the thrill of signing up for ActiveCampaign, dreaming of revolutionizing my email marketing. But today, my story takes a turn. I'm saying goodbye to ActiveCampaign, and here's why: 🚫 Clunky Interface: Feels like navigating through...

read more