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?
Who is Participating?
Chinmay PatelConnect With a Mentor Enterprise ArchitectCommented:
Hi Eindoofus,

Something like this?
// <copyright file="AssemblyInfo.cs" company="FullStack"> 
// Copyright (c) 2008 All Right Reserved 
// </copyright> 
// <author>Rhys Campbell</author> 
// <email></email> 
// <date>2008-09-10</date> 
// <summary>Contains assembly information.</summary>

Open in new window

Link :

EindoofusAuthor Commented:
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.
EindoofusAuthor Commented:
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#.
Chinmay PatelEnterprise ArchitectCommented:
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[]

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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.