Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!julius.cs.uiuc.edu!apple!netcom!teda!ditka!mcdchg!tellab5!balr!clrcom!rmartin From: rmartin@clear.com (Bob Martin) Newsgroups: comp.lang.c Subject: Re: Coding Standards. Message-ID: <1990Nov30.180913.20890@clear.com> Date: 30 Nov 90 18:09:13 GMT References: <2055.27469abd@iccgcc.decnet.ab.com> <1990Nov21.182209.23578@clear.com> <2753F21B.2F6@tct.uucp> Organization: Clear Communications, Inc. Lines: 27 In article <2753F21B.2F6@tct.uucp> chip@tct.uucp (Chip Salzenberg) writes: >According to rmartin@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@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. | Brought to you by Super Global Mega Corp .com