Comment out

Comment out

In computer programming, source code may be disabled by commenting out any given section of the code. This method is available in programming languages, markup languages, configuration files and other media that support comments. The term is also applied to any of various other means of temporarily disabling or removing source code from a computer program. [Source code may be disabled, for instance, with a conditional statement that is always false.]

Purpose

A programmer or author of code may use this approach when a subsection of 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.

Notes and references

External links

* [http://www.catb.org/jargon/html/C/comment-out.html Jargon file.]


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • Comment out —   [engl.], auskommentieren …   Universal-Lexikon

  • comment out — verb To temporarily disable a section of source code by converting it into a comment. Ant: uncomment …   Wiktionary

  • comment out — mark text so that a program will not refer to it …   English contemporary dictionary

  • Comment (computer programming) — For comments in Wikipedia markup, see Help:Wiki markup#Character formatting and WP:COMMENT. An illustration of Java source code with prologue comments indicated in red and inline comments in green. Program code is in blue …   Wikipedia

  • Comment (computing) — In computing, a comment is information in a file that is primarily intended as an annotation. The structure, scope and processing applied to this information depends on the syntax and conventions used to describe the information contained in the… …   Wikipedia

  • comment — /ˈkɒmɛnt / (say koment) noun 1. a note in explanation, expansion, or criticism of a passage in a writing, book, etc.; an annotation. 2. explanatory or critical matter added to a text. 3. a remark, observation, or criticism. –verb (i) 4. to write… …  

  • comment — com·ment n 1 often cap a: an essay analyzing, criticizing, or explaining a subject a comment published in the Yale Law Review b: an explanatory remark appended to a section of text (as of enacted code) 2: an expression of an opinion or attitude… …   Law dictionary

  • Out Flow — Compilation album by I ve Sound Released September 5, 2003 (Lament/Out Flow/See You box set) October 30, 2003 (individual release) Recorded 2000 – 2003 …   Wikipedia

  • Out of an Old Man's Head — Theatrical release poster Directed by Per Åhlin (animation) Tage Danielsson (live action) …   Wikipedia

  • Out From Under: Disability, History and Things to Remember — is a traveling exhibition that explores the history of disability within the lives of Canadians. The exhibition was produced in collaboration with students, scholars and alumni from the School of Disability Studies at Ryerson University.[1] The… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”