Coding Standards.

Bob Martin rmartin at clear.com
Sat Dec 1 05:09:13 AEST 1990


In article <2753F21B.2F6 at tct.uucp> chip at tct.uucp (Chip Salzenberg) writes:
>According to rmartin at clear.com (Bob Martin):
>>At Clear we have instituted a style standard which [...]
>>demands that comments always be placed on closing braces.
>
>In my opinion, mandatory comments on *syntactic* grounds are likely to
>lead to worse-than-nothing garbage like "++x; /* add one to x */" as
>programmers fill in just anything to comply with the standard.

This is a real risk, but it is seldom the case that a reasonable
identifier cannot be tacked onto a closing brace. 

The alternative of not demanding the comments on closing braces
exposes you to the danger of a function that has grown to span
(god forbid) multiple pages and has no comments telling you where
the braces line up.

Again the cost is negligible, the risk is low, and the benefit is
significant.



-- 
+-Robert C. Martin-----+:RRR:::CCC:M:::::M:| Nobody is responsible for |
| rmartin at clear.com    |:R::R:C::::M:M:M:M:| my words but me.  I want  |
| uunet!clrcom!rmartin |:RRR::C::::M::M::M:| all the credit, and all   |
+----------------------+:R::R::CCC:M:::::M:| the blame.  So there.     |



More information about the Comp.lang.c mailing list