Should .net comments start with a capital letter and end with a period?

Depending on the feedback I receive, I can raise this “standard” with my colleagues. This may become the usual StyleCop rule. is there already written?

So Stylecop already dictates this for documentation tags summary, paramand return.

Do you think it makes sense to demand the same from comments?

Relative note: if the comment is already long, should it be written down as the correct sentence?

For example (maybe I tried too hard to illustrate a bad comment):

//if exception quit

against.

// If an exception occurred, then quit.

If it appears - in most cases, if someone writes a comment, then it can be informative. Consider these two examples:

//if exception quit
if (exc != null)
{
    Application.Exit(-1);
}

and

// If an exception occurred, then quit.
if (exc != null)
{
    Application.Exit(-1);
}

, , , , , .

, . , .Net?

.

+5
5

, , . ( .) :

// SERVER

IDE , , , . . , a #region .

, :

// NOTE: -273.15 is absolute zero in °C, used for a MinValue below

, .

, , :

/// <summary>
/// Populates the properties of a Sensor object based on
/// the XML components of its data file.
/// </summary>

, , - , .

+5

, , IMO , , () , .

, , . , .

+6

, , ( , ), , . , .

, , , , . , , .

. - . , grok.

+3

, , , . - , . , , .

+2
source

if you are commenting on methods in visual studio, you should consider using summary information and parameters at the top of the method. This way, you have detailed information about the method during code completion. Here is an example

    /// <summary>
    /// you summary here
    /// </summary>
    /// <param name="param1">Describe parameter usage</param>
    /// <param name="param2">Describe parameter usage</param>
+1
source

All Articles