C# coding style: comments

后端 未结 10 1439
后悔当初
后悔当初 2021-01-17 15:59

Most C# style guides recommend against the /* ... */ commenting style, in favor of // or ///. Why is the former style to be avoided?

10条回答
  •  暖寄归人
    2021-01-17 16:28

    /* */ is fine for multi-line code blocks. For instance at the top of a code file, copyright info etc.

    // is easier for single line.

    Always use /// for at least all public members in a class as your XML documentation gets generated from that from which you can create help files.

提交回复
热议问题