0

Now, we all know that // makes a comment. But I have a question about the compiling of the program? Say you were to make a comment with a whole bunch of underscores to signify a different section of code. Does the amount of comments written in the source code increase the size of the final executed file or make the program any slower, even by a microsecond? Or does C++ just skip right over the comments or automatically delete them while compiling? Thanks in advance =)

5
Contributors
5
Replies
6
Views
9 Years
Discussion Span
Last Post by Denniz
0

As far as I know, the compiler should just ignore the comments while parsing your code. So it should not have any effect on executable size or speed.

0

stilllearning is correct. The compiler is only interested in the statements that do something so comments are not part of the compiled program.

0

>Does the amount of comments written in the source code increase the size of the
>final executed file or make the program any slower, even by a microsecond?
No, comments are stripped from the source during compilation.

0

Comments are ignored during the parsing stage. It has totally no effect on the final executable.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.