All courses / C# Basics for Game Makers / Your first program
Commenting out code
Challenge lesson, about 10 min, +20 XP
The night battle is over, and the tower is about to post its scoreboard on the quest wall. There is only one problem. The developer left test rows and debug messages in the code, and players are about to read something called Test Bot 0 in the middle of the leaderboard. You can fix this without deleting a single line, because you know how to switch code off with comments.
Deleting a line is permanent. If you need it again next week, you have to remember and retype it. Commenting it out keeps the line in the file but makes C# skip it. That is perfect for debug lines and unfinished features that you want to keep around.
Read the rest of this lesson and run the code in your browser.