I can't understand the virtues of using XML comments. I know they can be converted into nice documentation external to the code, but the same can be achieved with the much more concise DOxygen syntax. In my opinion the XML comments are wrong, because:
What then could have been be the reasons, why XML was preferred in .NET rather that the simple DOxygen syntax?
XML comments help speed development by providing IntelliSense on custom methods and other code constructs.
C# documentation comments use XML elements to define the structure of the output documentation. One consequence of this feature is that you can add any valid XML in your documentation comments. The C# compiler copies these elements into the output XML file.
The syntax for adding XML comments in your code is triple slashes /// followed by one of the supported XML tags.
The use of XML doc comments requires delimiters that indicate where a documentation comment begins and ends. You use the following delimiters with the XML documentation tags: /// Single-line delimiter: The documentation examples and C# project templates use this form.
I'm not saying that DOxygen isn't better, it's just that the xml commenting system is more familiar to everyone, and that goes a long way. It's just one less thing you have to train a new hire to do.
As far as leaving variables uncommented. What may be obvious to you, won't be to someone else (or to you 6 months later).
Ok now I think I see what you are asking.
Obfuscating comments. The color coding helps. Personally, I quickly scan past the grey text and only read what's green unless I need to read the xml text. (in my settings at least).
We have large monitors so we get more code on the screen in general. (It's cheaper to buy a large monitor than to retrain people generally). The other thing about this too, is that I bet you are only actively looking at one function at a time, so if that entire function fits on a page, you probably aren't suffering too much from not seeing more code. Now if the functions are long, then I could see that being a problem.
We put the summary comments on a single line when possible (assuming it isn't really large). That cuts down on the used space.
I don't know if DOxygen does this, but you can collapse the comments so they are out of the way.
The primary job of XML documentation is not to generate documentation. It is to provide good IntelliSense info for the client of your class. Ship the generated .xml file along with your assembly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With