Link to home
Start Free TrialLog in
Avatar of Eindoofus
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?
Avatar of tony_techtoneic
tony_techtoneic
Flag of Australia image

Avatar of Eindoofus
Eindoofus

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
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.