|
|
|
|
|
by walking
3783 days ago
|
|
From sibling post:
> when dealing with those annoying UBER-Forms that tend to happen when dealing with legacy WinForms code :) This is similar to my experience. I use regions pretty often when I'm refactoring overgrown legacy code, especially older MVC apps (where the controllers get insane) Basically what you said, but reversed. I use regions as a first step to regaining some kind of order, then continue to pull things apart into more properly factored classes, methods, etc. It helps me mentally map things out. Of course there're a bunch of ways you could do that, but Visual Studio has good support for folding regions, so I prefer it. That folding is the second reason I'll use them sometimes. If I have a really awkward part of code that I'd like to fold for whatever reason, I'll occasionally use them if I think it'll make things more readable. I agree with the idea, though. Every time I use a region I have to stop and think "am I just hiding bad design?" |
|
Oh dear lord the MVC madness I've seen... thousand yard stare