So far, we’ve dealt with some of the program text the compiler cares about the most. If you make mistakes with regard to syntax or more involved rules, you’ll be punished and prompted to correct the error. As valuable as source code itself are comments to document the code. Even though good source code should be self-explanatory for the most part—because of the use of meaningful identifier names and so on—correct use of comments is invaluable, too.
Being a C-style language, C# inherits a few of its commenting styles from that group of languages. Let’s take a look.