When I say "comment out", does it mean to uncomment something or comment it?
What is more better, or correctly, used?
PS: I'm talking about source code.
|
When I say "comment out", does it mean to uncomment something or comment it? PS: I'm talking about source code. |
||||
|
|
|
To comment out is to render a block of code inert by turning it into a comment. In C# code for example, commenting out code is done by putting
To uncomment something means to remove the characters that makes it a comment. The expression only makes sense if the comment contains something that would work as code, usually something that was commented out earlier. To uncomment a regular comment would just cause a syntax error. |
|||
|
|
|
"Comment out" means to use comment syntax to remove something from the parsed code. "Uncomment" is the reverse operation. They are both the correct expression for their respective referents. |
|||||||||||||||||||
|
|
As reported by the NOAD, the meaning of comment out is "(computing) turn part of a program into a comment so that the computer ignores it when running the program."
The definition provided by Dictionary.com is the following one:
The PC Magazine Enciclopedia defines comment out using the following words:
Answers.com defines comment out as "(computer science) To render a statement in a computer program inactive by making it a comment." Comment out doesn't mean to remove a comment, but to add a comment to ,e.g., a code line to avoid it gets compiled or interpreted. |
|||
|
|
|
The idea is "remove by commenting/turning into a comment". Note that "out" is used to mean remove in a number of phrasal verbs: "dig out", "force out", "smoke out" etc-- and indeed, on more or less the same analogy "wipe out". As the opposite, you can "uncomment" a line/section, or you "comment it back in". The latter is slightly odd, because logically you are uncommenting so that the code to be put back in. But hey, language doesn't always use the same logic as mathematics. |
|||
|
|
|
For me when you comment it is to clarify something that will make it easier for the user to understand like in c++(although a simple example and should not be used like this):
But shall someone say comment out I think of the coder commenting out a line or section of code to see what happens with program execution. Such as this: First code:
And then commenting out a line to see what will happen with the program:
The first code will output 4 but when I comment out the second line it will output 0 I simply use this so that I don't have to delete code and then rewrite it because twe |
|||
|
|