Hello there. I am currently designing code for an Xbox 360 Game. The code runs on C++, and I have a question. While I read through the templates for my game, I see on every line a comment:
//comment here
These comments usually give advice to the editor (me) while editing and reviewing code. So for example, I see this:
//if there is nobody chosen for some reason, then just force him on a player
So I ask. Is it safe to remove these types of things, or is it needed for debug. I do see the "//''s, but I also see code behind it. Any ideas. Thanks.
That's called "commenting out". You turn code you temporarily want to disable or code that you might need at a later date for debugging into comments. Since comments don't affect the behavior of the program, you can safely remove them if you want.
When people comment out code, it's usually because it's incomplete, buggy, an optional/experimental feature, or the code is for debugging only (like assert()).
It is a common habit among professionals to use #if 0 ...#endif to comment out incomplete/buggy/optional/experimental stuff. Using #if 0 is an immediately recognizable signal to others that it is the case.