Jun 6, 2011

Anaesthetic for your #region-itis

If your code (or the rest of your team) suffers from a bad case of #region-itis then help is at hand.

There’s a lovely little Visual Studio extension over at http://teamsearchapp.com/region-tool that will automatically expand #regions, and also make those #region lines much smaller and harder to read than your normal code.  No more pressing shortcuts to expand all those blocks, less visual clutter and optionally, the ability to prevent collapsing of #regions.  What’s not to like?

Borrowing a few pictures from their site, it takes the #region afflicted code (on the left) and reveals it’s ugly inner truth (on the right):

Regions1 Regions2 

Ahh! That’s much better.

1 comment:

  1. Hi Richard,

    I have to ask (and i know ill probably be flamed into oblivion for this by other people), but what is so wrong with regions? Personally i like regions (i heard you gasp just then ;) ), as long as we developers use them properly and not to hide crappy/irrelevant code.

    Interested in your thoughts :)

    ReplyDelete