Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have never encountered any limitations when using asterisks over the double (or triple) slashes. For whatever reason, the C# community has decided to use double slashes for comments.</p> <p>Interestingly it appears the double slash comments came out of C++ and Java. Below I have included a list of languages an what denotes a comment in the language:</p> <ol> <li>ALGOL 60 - ; (semicolon)</li> <li>Assembly Languages - ; (semicolon)</li> <li>Ada, mySQL - -- (two dashes)</li> <li>C++/Java - // (two slashes)</li> <li>FORTRAN 90 - ! (exclamation mark)</li> <li>Perl, TCL, UNIX Shell, mySQL - # (hash sign)</li> <li>Visual Basic .NET - ' (apostrophe)</li> </ol> <p>The following are example of tools using the double slashes as single line and double line comments.</p> <p><strong>Visual Studio</strong> Highlight a block of code and use the key combinations Ctrl + K + C and the code is commented out using the single line double slashes.</p> <p><strong>Ghost Doc</strong> <a href="http://submain.com/products/ghostdoc.aspx" rel="nofollow">Ghost Doc</a> is a tool that auto generates documentation for the method. It use the triple slash notation. It's my understanding that the triple slash with the use of XML elements in the comments allows tool such <a href="http://ndoc.sourceforge.net/" rel="nofollow">NDoc</a> and <a href="http://shfb.codeplex.com/" rel="nofollow">Sandcastle</a> generate MSDN-style HTML Help format.</p> <p><strong>Atomineer Pro</strong> <a href="http://www.atomineerutils.com/" rel="nofollow">Atomineer Pro</a> is another tool that will generate method level documentation from the method name and parameter names. It also used the triple slash notation by default. </p> <p><strong>MSDN C# Coding Standards</strong> The <a href="http://msdn.microsoft.com/en-us/library/vstudio/ff926074.aspx" rel="nofollow">C# coding standards</a> say to use the double slash, and not to use the block comments.</p> <p><strong>iDesign C# Coding Standards</strong> While <a href="http://www.idesign.net/" rel="nofollow">iDesign</a> is not Microsoft, I've always felt they were a bit of an authority in the C# community. They have published a C# Coding Standard document which states the double notation is the preferred method.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload