Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!news.cs.indiana.edu!cica!tut.cis.ohio-state.edu!abvax!iccgcc!browns From: browns@iccgcc.decnet.ab.com (Stan Brown) Newsgroups: comp.lang.c Subject: Re: Coding Standards. was: a style question Message-ID: <2055.27469abd@iccgcc.decnet.ab.com> Date: 18 Nov 90 19:29:17 GMT References: <1990Oct23.160116.10299@athena.mit.edu> <13@christmas.UUCP> <14369@smoke.brl.mil> <1990Nov10.191840.21113@clear.com> Lines: 35 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. Am I the only one who thinks this extremely silly? int io_fatal_error_count = 0; void io_error(int code) { char *errmsg; errmsg = io_stget(code); if (errmsg == NULL) { ++io_fatal_error_count; printf("Error code %d: full explanation not available\n"); } /* end if errmsg is NULL */ else printf("Error %d: %s\n", code, errmsg); } /* end of function prterr */ 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. Please do not attribute these remarks to any other person or company. email: browns@iccgcc.decnet.ab.com Stan Brown, Oak Road Systems, Cleveland, Ohio, USA +1 216 371 0043