Are #regions an antipattern or code smell?

Posted by Craig on Programmers See other posts from Programmers or by Craig
Published on 2011-02-28T22:45:30Z Indexed on 2012/06/05 22:47 UTC
Read the original article Hit count: 332

Filed under:
|

In C# code it allows the #region/#endregion keywords to made areas of code collapsible in the editor. Whenever I am doing this though I find it is to hide large chunks of code that could probably be refactored into other classes or methods. For example I have seen methods that contain 500 lines of code with 3 or 4 regions just to make it manageable.

So is judicious use of regions a sign of trouble? It seems to be to me.

© Programmers or respective owner

Related posts about c#

Related posts about code-smell