Clearing out old drafts...
Yes, a team needs to agree on a coding standard and consistently follow that standard. That being said, I think the coding standard should be kept as simple as possible and only grow as needed. I think elaborate coding standards that are hard to remember or require developers to go out of their way to follow it do more harm than good. A couple years ago I watched a client organization spend a tremendous amount of energy enforcing an elaborate coding standard in coding reviews and completely neglect the (poor) structure of their design. There's a point of diminishing returns on coding standards and it comes up fast. Learn to like the default "{}" placement in VS.Net or a simple configuration of ReSharper and live with it.
There's tons of coding standards on the web that you can download and use built by acclaimed .Net experts. I'd bypass all of them. A team is much more likely to follow a standard that they've built themselves. Let the coding standard grow organically as you encounter new needs. There's absolutely no need to spend a week defining a 200+ point standard upfront because nobody will be able to follow it anyway.
And the silliest coding standard I've ever seen was the initial C# coding standard at a past employer that was made before anybody had written a single line of C# code. Here's the highlights as I recall:
- Always use abstract classes instead of interfaces because you can reuse functionality in the abstract classes. There are reasons why the language includes both constructs.
- Every method should have a comment block listing the history of changes to that method. Source control anybody?
In the words of Forrest Gump, "that's all I've got to say about that."
Posted
10-29-2006 10:33 AM
by
Jeremy D. Miller