What is comment? - Definition from WhatIs.com
Part of the Programming glossary:

Often cited as one of the most useful and least used programming conventions, a comment is a text note added to source code to provide explanatory information, usually about the function of the code. Comments are usually helpful to someone maintaining or enhancing your code when you are no longer around to answer questions about it. Peer developers sometimes assess code for the completeness and readability of its comments.

To enable the programming language compiler to recognize comments and not confuse them with instruction s, a special character is used (such as "#," " /* ," " ' " and " // ") to signal the beginning or the end of a comment. The HTML comment start characters ( <!-- ") tell the browser not to display the text between them and the end characters (" --> "); the text within these comment framing characters is visible, however, to anyone reading the code. Reading this page in a Web browser, for example, you can select "View" and then "Source" to see the HTML code for the page, including the comments.

A program should include at least: a file comment block that describes the contents of the file, so that someone reading the file can understand it without having to read the code itself, and a function comment block that describes each functional unit of code. In addition, some coders provide a comment for each language statement.

This was last updated in August 2005
Posted by: Margaret Rouse

Related Terms

Definitions

Glossaries

  • Programming

    - Terms related to software programming, including definitions about programming languages and words and phrases about software design, coding, testing and debugging.

  • Internet applications

    - This WhatIs.com glossary contains terms related to Internet applications, including definitions about Software as a Service (SaaS) delivery models and words and phrases about web sites, e-commerce ...

Ask a Question. Find an Answer.Powered by ITKnowledgeExchange.com

Ask An IT Question

Get answers from your peers on your most technical challenges

Ask Question

Tech TalkComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.