Formatting Code the Right Way

If you’ve ever been involved in a large development project, you probably experienced the code formatting nightmare.  How many spaces to indent?  Where does the open brace go?  Should you indent case labels?  There’s little possibility that you’ll convince a group of programmers that your way is best, and invariably you’ll end up with an imposed standard that nobody supports 100%.  Imposing the standard is the easy part.  Enforcing it is something else entirely.

Visual Studio 2005, which will ship when the .NET Framework 2.0 ships, has some pretty impressive code formatting built in to the C# editor.  With it, you can set formatting standards that are enforced automatically as the code is typed.  And you can reformat code almost instantly.  It’s very cool stuff.

I just finished a brief review of these new formatting features.  Check out Formatting Code the Right Way over at DevSource.