Wikipedia:

Comment out

In computing the term commenting out refers to the practice of converting some source code within a file, or the contents of a software configuration file, as comments (often block comments) to a form that has no effect on the execution of a program.

In some cases the code is commented out by using a language construct that ensures it is never executed. For instance, a conditional statement that is always false or through the use of a preprocessor.

This is may be done when the code is redundant or obsolete, but is being left in the source to make the intent of the active code clearer, or when a piece of code is faulty and a temporary bypass is needed in order to debug another part of the code.

Problems with usage

Commenting out can be onerous in languages that do not have block comments, and has its own hazards in certain languages that do have block comments. For example, in C, the comment delimiters may not be nested, so /*/*Foo*/*/ is the comment /*Foo, followed by the literal code characters */, which can lead to bugs when a section of code containing block comments is commented out. In C, a conditional preprocessor directive should generally be used instead. Some languages, like Haskell, avoid this by allowing the nesting of block comments, so the example above (translated into Haskell) read {-{-Foo-}-} and is actually the comment {-Foo-} and no characters of code.

External links


This article is based in part on the Jargon File, which is in the public domain.



 
 
 

Join the WikiAnswers Q&A community. Post a question or answer questions about "Comment out" at WikiAnswers.

 

Copyrights:

Wikipedia. This article is licensed under the GNU Free Documentation License. It uses material from the Wikipedia article "Comment out" Read more

Search for answers directly from your browser with the FREE Answers.com Toolbar!  
Click here to download now. 

Get Answers your way! Check out all our free tools and products.

On this page:   E-mail   print Print  Link  

 

Keep Reading

Mentioned In: