Maybe I should ask this directly to Eric Gunnerson or other guys from Redmond, but here goes:
I would like the .Net language compilers to support given coding standards, and refuse to compile code that doesn't meet them.
Update: make that "I would like the MSBuild system to support given coding standards, and refuse to build solutions that don't meet them." Makes a lot more sense... Thanks to Scott Galloway for remarking that.
One example is a maximum Cyclomatic Complexity for methods. Cyclomatic Complexity, also called McCabe Complexity or McCabe's Metric, is a software metric that computes the complexity of a function. In short, it equals 1 + the number of branches (ifs, whiles, foreaches etc.). A CC of more than 20 is considered too complex; so if a method has a CC of more than 20, it should be refactored.
Wouldn't it be cool if MSBuild would refuse to compile methods that exceeded a given (configurable?) complexity? This would mean developers wouldn't even be allowed to check in code that is too complex. Of course, you should be able to turn this off, so that you'd still be able to work in "Quick & Dirty" mode for a while. But once it's decided that all code must meet given minimum standards, why not let the development environment enforce them?
Another example: the compilers could refuse to compile classes that contain only static (Shared) methods and (a) constructor(s). This type of code is a violation of good coding behavior, so the developer would either have to remove the constructor(s) or make (some) methods un-static, so to speak. (As Marc Sigrist remarked, the example is badly chosen because its situation may actually be what the author wants (if the constructor is private). Thanks Marc!)
What do you guys think?