2 ms·
I don't see how hiding large chunks of code behind a drop-down is making it "easier to navigate in Visual Studio." If anything it is now much harder. Plus you'
by Someone1234 11y ago
I don't see how hiding large chunks of code behind a drop-down is making it "easier to navigate in Visual Studio." If anything it is now much harder.
Plus you're now burying how long your class is and the individual methods within. So a class or method that would otherwise be inappropriately long now looks a reasonable length.
If you feel like the code is so long that it needs regions, then refactor the code, don't hide the mess under the bed.
- walking 11y agoI can't speak for the gp, but they were talking about inheriting a project/legacy code. If I end up needing to go through legacy code, and there are a lot of gnarly, long methods/blocks, I'll usually add comments and regions to it as I go along. I'll use comments if I just want to note something, and a region if I want to note something about a region of code. It's my rough map. Being able to tell Visual Studio to arbitrarily collapse an area is handy for sketching it. The long term goal is to refactor, but it's handy as a way to quickly outline things.
- kenjackson 11y agoPoint me to some of your code and I bet it would benefit from well placed regions.