All courses / C# Basics for Game Makers / Your first program

Comments

Demo lesson, about 8 min, +25 XP

Code gets read much more often than it gets written. Dungeon of Dawn will grow to thousands of lines, and you will want notes in it. A comment is a note you leave for people, and C# skips it completely when the program runs.

Two slashes start a comment that lasts until the end of the line. For a longer note, put it between /* and */. You can also put two slashes in front of a real line of code to switch it off for a while. Coders call that commenting out code.

Read the rest of this lesson and run the code in your browser.

Previous: Fixing compiler errors   Next: Commenting out code

© 2026 Xero Media LLC. All rights reserved.