Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there published style guidelines for C# XML documentation? [closed]

I ask my developers who write C# code to follow StyleCop's guidelines. It's great for code, but I almost always have questions about documentation (ok...ok...so no one asks, because programmers tend to hate documentation) style. I could suggest copying MSDN's style, but I'm curious whether Microsoft or someone else has published something about this.

For Example, constructors are documented as follows.

/// <summary>
/// Initializes a new instance of <c>MyClass</c> using the specified <c>BaseMyClass</c>.
/// </summary>
/// <param name="myParam">The <c>MyParam</c> of the current session.</param>

I'm not trying to spark a debate over how documentation should be written, here. I'm looking for some kind of published guidelines about the suggested syntax for documentation.

Thanks in advance!

like image 540
Ed Altorfer Avatar asked Jan 08 '10 19:01

Ed Altorfer


1 Answers

StyleCop FxCop actually provides rules for XML documentation, as well. If you don't follow the pattern that are set by a certain set of rules, it will complain.

These are all rules SA1600-SA1647.

For example, rule SA1642: ConstructorSummaryDocumentationMustBeginWithStandardText states that :

The summary for a non-private instance constructor must begin with “Initializes a new instance of the {class name} class.”

For more information, see FxCop.

like image 121
Reed Copsey Avatar answered Nov 14 '22 23:11

Reed Copsey