Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!mcdchg!tellab5!balr!clrcom!rmartin From: rmartin@clear.com (Bob Martin) Newsgroups: comp.lang.c Subject: Re: Re: Coding Standards. was: a style question Message-ID: <1990Nov21.182209.23578@clear.com> Date: 21 Nov 90 18:22:09 GMT References: <14369@smoke.brl.mil> <1990Nov10.191840.21113@clear.com> <2055.27469abd@iccgcc.decnet.ab.com> Organization: Clear Communications, Inc. Lines: 33 In article <2055.27469abd@iccgcc.decnet.ab.com> browns@iccgcc.decnet.ab.com (Stan Brown) writes: >In article <1990Nov10.191840.21113@clear.com>, rmartin@clear.com (Bob Martin) writes: >> >> The lack of standard coding practice IS a big problem for software >> maintenance. At Clear we have instituted a style standard which >> [...] demands that comments always be placed on closing braces. > >Given _any_ rule in a coding standard, it's possible to come up with an >example where applying the rule is inappropriate. But the rule cited >above is the other way round: following it is more likely to hurt than >help. Following it blindly will certainly hurt. > >Just to hammer homee the point: My problem is chiefly with the "always" >part of the cited rule. The "ALWAYS" is present because it is the safest course. Programmers are not always very good at predicting what changes will be made to their code in the future. If he makes decides that comments on his closing braces are not important because his conditionals are trivial, then he is ignoring the possibility that two years from now some other engineer my add many lines of code to his conditionals, making the comment on the closing brace useful. The convention is "demanded" because it is cheap, easy, has very few down-sides, and the _possibility_ of significant up-sides. -- +-Robert C. Martin-----+:RRR:::CCC:M:::::M:| Nobody is responsible for | | rmartin@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. |