What is the difference between ///
and #region ...#endregion
statements in c#? Which one the best?
///
-> can be used for some comments
#region ...#endregion
-> can be used to mark particular set of code to a region,easy to reffer
#region MainMethod
/// <summary>
/// Comments
/// </summary>
static void Main()
{
//Your code
}
#endregion
/// <summary>
/// Three forward slashes denote a documentation comment, which can be used in
/// conjunction with documentation tooling to generate API documentation for
/// your code.
/// </summary>
// two forward slashes denote a code comment, which you can use to provide
// commentary within your code
/*
This style of comment is called a block comment, which can be used to easily
comment out large blocks of text within your code
*/
#region Some Region Name
// the above region allows the developer to collapse/uncollapse everything
// within it, as long as their IDE supports regions
public void SomeMethod()
{
}
#endregion