comment

(redirected from commenting)
Also found in: Dictionary, Thesaurus, Legal, Idioms, Wikipedia.

comment

[′käm‚ent]
(computer science)
An expression identifying or explaining one or more steps in a routine, which has no effect on execution of the routine.

comment

(programming)
(Or "remark") Explanatory text embedded in program source (or less often data) intended to help human readers understand it.

Code completely without comments is often hard to read, but code with too many comments is also bad, especially if the comments are not kept up-to-date with changes to the code. Too much commenting may mean that the code is over-complicated. A good rule is to comment everything that needs it but write code that doesn't need much of it. Comments that explain __why__ something is done and how the code relates to its environment are useful.

A particularly irksome form of over-commenting explains exactly what each statement does, even when it is obvious to any reasonably competant programmer, e.g.

/* Open the input file */ infd = open(input_file, O_RDONLY);
References in classic literature ?
During the whole evening he had remained in one of the corridors, chatting with Bernouin and Brienne, and commenting, with the ordinary skill of people of a court, upon the news which developed like air-bubbles upon the water, on the surface of each event.
He turned to me with that horrible trick of his of commenting upon Mills as though that quiet man whom I admired, whom I trusted, and for whom I had already something resembling affection had been as much of a dummy as that other one lurking in the shadows, pitiful and headless in its attitude of alarmed chastity.
Its splendour was in such contrast to his homely ways and simple life that I could not help commenting upon it.
There are the gushing young ladies who, having read "David Copperfield," have thereupon sought out a small, longhaired dog of nondescript breed, possessed of an irritating habit of criticising a man's trousers, and of finally commenting upon the same by a sniff indicative of contempt and disgust.
Casaubon's time of life, she had no means of knowing, so that he could not have the advantage of comparison; but her husband's way of commenting on the strangely impressive objects around them had begun to affect her with a sort of mental shiver: he had perhaps the best intention of acquitting himself worthily, but only of acquitting himself.
Weston commenting upon the brightness of the morning and the beauty of the bay, and then upon the advantages A possessed over many other fashionable places of resort.
Some of the shes came very close and plucked at her garments, commenting upon them to one another in their strange tongue.