Thorough documentation with XML comments

Self-documenting code is ace, keep doing it. But, when you want to give more information to consumers of your code (which you should), XML comments are key and should probably be defined on any public facing methods or properties that are not immediately obvious to the total noob.

Basic XML Comment

Hopefully you already know what an XML comment is. Here's one:

MyClass.cs //C#
/// <summary>
/// Cooks your toast
/// </summary>
public void DoSomething()
{

}

This gives our devs a nice bit of intellisense on what your method actually does:

Parameters and Return Types

If your method has parameters and/or return types, the placeholders are added for you when you type the ///:

MyObject.cs //C#
/// <summary>
/// Checks the value of <paramref name="myString"/>
/// </summary>
/// <param name="myString">String to check value of. Should be numbers only.</param>
/// <returns></returns>
public bool CheckValue(string myString)
{
    int number;
    return int.TryParse(myString, out number);
}

Exceptions

It is certainly useful for callers of your code to know which types of exceptions your method could throw. Listing them in exception comment tags allows devs to see this information without stepping into the method.

MyObject.cs //C#
/// <summary>
/// Checks the value of <paramref name="myString"/>
/// </summary>
/// <param name="myString">String to check value of. Should be numbers only.</param>
/// <returns>True if the string is numeric</returns>
/// <exception cref="ArgumentException">Reason for exception here</exception> 
public bool CheckValue(string myString)
{
    int number;
    if (int.TryParse(myString, out number))
    {
        return true;
    }
    else throw new ArgumentException("Numbers only, dummy");
}

Example Usage

Give your fellow devs an exmaple of how you expect your code to be used. Unfortunately this isn't shown in the tooltips that Visual Studio shows when you hover over members, but it will be in any auto-generated HTML documentation you export.

MyObject.cs //C#
/// <summary>
/// Checks the value of <paramref name="myString"/>
/// </summary>
/// <exception cref="ArgumentException"></exception> 
/// <param name="myString">String to check value of. Should be numbers only.</param>
/// <example>
/// <code>
/// new MyObject().CheckValue("123");
/// </code>
/// </example>
/// <returns>True if the string is numeric</returns>
public bool CheckValue(string myString)
{
    int number;
    if (int.TryParse(myString, out number))
    {
        return true;
    }
    else throw new ArgumentException("Numbers only, dummy");
}

Additional Remarks

Anything else that needs to be mentioned can be said in the remarks tag.

/// <remarks>This is just a dummy method</remarks>

Referencing Other Types

If you need to mention another type in the XML comments, use the see tag.

MyObject.cs //C#
/// <summary>
/// Checks the value of <paramref name="myString"/>. For use with <see cref="TestClass"/> 
/// </summary>

Automated Comments with GhostDoc

If this feels like too much manual work, you might like to look at the GhostDoc extension, which handles a lot of the setup and maintenance for you. You can left click on a method and press Ctrl + Shift + D to generate an XML comment for you. It can also give you a preview of the method documentation.

Whatever you do, please don't write comments like this:

BadComment.cs //C#
/// <summary>
/// Gets the thing
/// </summary>
public object GetThing() 
{

}

Conclusion

Proper documentation makes our lives easier in the long run, so being as helpful as possible is always a good idea.

I'm a bit gutted the Visual Studio tooltips still don't include information like the code tags and examples/remarks, so would love you to leave a comment if you know of an extension that does this. Otherwise I may investigate building one.