Refactor! Pro and SA1503
I'm busy as blood-engorged zombie locusts tearing into each other until one stands atop the heap like Jet Li in The One. I've been fixing my code files one by one to conform to the rules in StyleCop. Luckily I have Refactor! Pro from Developer Express.
StyleCop rule SA1503 is that "The body of the if statement must be wrapped in opening and closing curly brackets. The following is a no-no:
Instead, write:
or:
Is it anal? Sure. But that's what code style is all about. Making your code look the same so that your eye flows across it smoothly and quickly. Meaning should be standard. Beating a different drum doesn't mean you can't keep in lock-step. At least with yourself.
The cool part is that Refactor! Pro makes this a three-keypress action. Place the cursor right after the if statement and before the "doAnAction". Press the R!P key. Press Enter.
You just used the "Add Block Delimiters" action, and bam! Perfect code.
Now if I just need to find (or create) the actions to put proper white space after my code blocks, use "this." before accessing an field, and alphabetize my "using" statements. I think it's too much to ask that an inexpensive developer tool get rid of the zombie locusts.