In Defense of Flower-Boxes

Arnold Trembley (arnold.trembley@worldnet.att.net) describes a context where the right-hand asterisks may be worth saving. He writes:
In my shop, we try to encourage the use of "flower-box" comments. I wrote a COBOL style checker for my group, and one of the things it checks for is commented-out code. My previous boss absolutely hated it. His view was that you should leave the history to the version control utilities, and he did not want production programs cluttered with commented-out code.

All well and good, but how do you check for commented-out code? I check for comment lines containing COBOL reserved words. But some of them, such as IF, could easily appear in a real comment that was never COBOL source code. The solution was to allow ALL comments completely enclosed in flower-boxes, and to assume that comment lines were originally code lines if they contained one or more reserved words without a trailing asterisk.

It is true that there is some extra maintenance to keep a trailing asterisk on a comment line, but I don't check its relative position. Not every shop will have its own style-checker, so our approach might not be helpful for other users.

If you find yourself in Mr. Trembley's shoes, I suggest that you come up with another convention to safeguard comments. For example, insist on a '!' in column 8. Such comments would be easier to maintain (and probably easier for a style checker to detect) than those with a trailing asterisk.

Of course neither convention, nor any other I can think of, would prevent a programmer from protecting commented-out source code, despite the shop standard.


homeCOBOL Home [style forum]COBOL Style Forum