comment

(redirected from commented)
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 ?
These words, which he scattered with a sort of discretion, reserve, and preference, were commented upon earnestly by two persons, -- the king and the cardinal.
Upon my word, she does it very well," he tacitly commented.
The son of a confounded millionaire soap-boiler," commented Mr.
commented young Hagberd, scornfully; "just the thing he would be proud of.
With the shrewdness that usually accompanies malice, Amelie Thirion had noticed, analyzed, and mentally commented on the extreme preoccupation of Ginevra's mind, which prevented her from even hearing the bitterly polite war of words of which she was the object.
Seems like he gets thinner every day," he commented, anxiously.
When our juggling friend here threw up the three glasses in turn, he counted them aloud as he caught them, and also commented aloud when he failed to catch them.
So it was as well that Miss Bartlett should tap and come in, and having commented on Lucy's leaving the door unlocked, and on her leaning out of the window before she was fully dressed, should urge her to hasten herself, or the best of the day would be gone.
She saw nothing at supper-time of the superior milker who had commented on the story, and asked no questions about him, the remainder of the evening being occupied in arranging her place in the bed-chamber.
His light-hearted abandon on the Wiggle-Woggle had been noted and commented upon by several lookers-on.
H'm--been in bigger places, I suppose," the other commented.
He was the witness of a thousand little scenes between the gypsy and the deaf man, the pantomime of which, viewed from afar and commented on by his passion, appeared very tender to him.