Comments

Comments are additional notes which do not affect the execution of the program in any way and are very useful for explaining things about your code and your reasoning. There are 3 types of comments in C#:

Name Example
Single Line
// Everything on this line after the double slash is part of the comment.
Block
/* Everything from the "/*"
   on any number of lines
   is part of the comment
   until it reaches the next */
Documentation
/// <summary>
/// Tripple slash comments
/// can also take up as many lines as you want.
/// <para></para>
/// They must be placed above a particular member (class, method, field, etc.)
/// <para></para>
/// They can be displayed by an IDE to give you information about that member.
/// So you do not need to always go to other scripts to find out their details.
/// <para></para>
/// They use XML tags (often only "summary") for various formatting purposes.
/// </summary>

Click here for an example:

The Strings class in Animancer has the following comment:

/// <summary>Various string constants used throughout Animancer.</summary>
public static class Strings
{
   ...
}

This allows Visual Studio to display that text as a tooltip when you hover over any reference to that class:

It also allows Wyam (the tool used to generate this documentation website) to show that comment in the API Documentation for the Strings class.

In Visual Studio, typing /// before any member (class, method, field, etc.) will automatically insert a tripple slash comment for it.