Is this the best way to document code in C #?
/// <summary>
/// Descrição
/// </summary>
Is this the best way to document code in C #?
/// <summary>
/// Descrição
/// </summary>
This is the default way to create documentation for the code made in C #. This is where Visual Studio takes explanations of what the method does to show when you point the mouse at the method or property.
When you are making a call to a function for example, each parameter can have a different explanation of what it does. This is shown by Visual Studio during encoding which helps a lot.
There are tools that can generate documentation for you when you use this type of documentation. Visual Studio itself, when you compile a code it also generates an XML with this documentation , which you can send along with your libraries to provide documentation inside Visual Studio ... just as it does when you point the mouse over the method.
Yes.
Not only <summary>
, but all documentation items. This information is mapped by IntelliSense from Visual Studio and appears in the Code Completion (complete-code).
The minimum body of documentation has the following:
/// <summary>
/// Método selecionar padrão. Recebe uma lista de operadores para selecionar do banco e devolver uma lista
/// </summary>
/// <param name="operadores"></param>
/// <param name="tipoResolucao"></param>
/// <returns>Lista de operadores tipada.</returns>
/// <remarks>Deve ser implementado em cada classe derivada.</remarks>
There are several other tags for documentation. To see them, simply add three bars and open the ; tag you'll see more options in Code Completion .