Regions in C#

by Remy van Duijkeren | Apr 11, 2023 | Shorts

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.

Related

Hourly billing kills love.

Hourly billing kills love. I saw it happen again and again at implementation partners. Everything starts fun… and then it slowly burns down. Year 1:...

Read More