Question

So far I understand that its good practice to XML comment a classes methods but is there a standard for how much you should use XML comments?

Should I be using them to document field variables, properties & constructors or is that just overkill?

Had a look about the web but can't see any hard and fast rules for this sort of thing.

Was it helpful?

Solution

There are two reason to use XML comments opposed to plain English:

  1. If the comments follow the correct format they will show up in IntelliSense, meaning when I use your class I can see that int a is supposed to be the count or whatever the same way I see helpful info when I'm using .NET methods,

  2. If you use the XML formats Microsoft supports you can create html (or other formats of) documentation using SandCastle or similar third party utilities.

So, if you're taking the time to write comments, you may as well make them the XML ones that VS encourages.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top