Documentation – Enforcing Programming Standards for Shared Libraries

documentationstandards

Myself and another developer with the go ahead from our IT director have started a general purpose library in .NET with the intention that it will provide many common purpose classes that we use in our day to day development.

During discussions and design of the library we have come up with a set of standards that we want the library to follow to ensure it is maintained and expanded on in a consistent manner.

What is the best way to ensure these decisions we made for the library get feed to the other developers who might be using and adding to this library in the future. One of our decisions was to ensure we review all checked in code so we expect initially there to be some differences in coding styles of individuals not fitting in with the project standards.

Some ideas I had were:

  1. Add a Read-me.txt to the project that outline the guidelines and standards
  2. Send an email out to everyone in the team to let them know about the project etc
  3. Call a team meeting to go through this new project and our expectations and standards we were aiming to follow
  4. Try and enforce the standards via Visual Studio (not sure if this would be possible or how just an idea)

At the moment there is no general company programming standards so this would be a first really insofar as we are creating a standard that different project teams would need to adhere to.

Best Answer

Use FxCop and StyleCop to analyze and enforce rules that describe the coding standard you expect for your library. You could also write up a document that explains your coding standard, but using code analysis is the best way to actual enforce them.

Edit:

See this question for more information about the code analysis available in certain versions of Visual Studio.