Eindoofus
asked on
Any suggestions on how to comment the top of a C# class file?
Are there any standard practices for adding comments to the top of a C# file? For example, I would imagine that it should include something like the author and date.
I need to submit a C# code file to a potential employer and I'd like to know if their is anything that is considered good practice when labeling a class?
I need to submit a C# code file to a potential employer and I'd like to know if their is anything that is considered good practice when labeling a class?
ASKER
That seems a bit bloated. I was just hoping for some simple comments that show up in XML for the author and date that I can add to the top before all of my "using" statements.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks. Once last thing, should it be three slashes rather than two? I always thought it was the norm to put /// before XML tags in C#.
XML tags always have ///
and normal code comments can have //
These are not XML comments as such, these are as per the guidelines of StyleCop[http://stylecop.codeplex.com]
You can also use
- StyleCop
- FxCop[codeplex] OR Code Analysis [built into Visual Studio for Ultimate Edition - not sure about others]
- Code Metrics [built into Visual Studio]
This will help you a lot to improve your code.
Regards,
Chinmay.
and normal code comments can have //
These are not XML comments as such, these are as per the guidelines of StyleCop[http://stylecop.codeplex.com]
You can also use
- StyleCop
- FxCop[codeplex] OR Code Analysis [built into Visual Studio for Ultimate Edition - not sure about others]
- Code Metrics [built into Visual Studio]
This will help you a lot to improve your code.
Regards,
Chinmay.
http://www.codeproject.com/Articles/26248/Developing-a-Visual-Studio-Add-in-to-enforce-compa