Regions in C#

by Apr 11, 2023Shorts

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 Automator

Automation and integration aren’t just what I do—they’re what I do best.

I help businesses work smarter by removing friction, automating what slows them down, and connecting systems that should’ve been talking all along.

 

Get My Thoughts on Automation & Development

Join my personal newsletter and get practical insights on building faster, integrating smarter, and removing friction in IT systems — especially on Power Platform and Dynamics 365.

Related