Coding Standards. was: a style question
Stan Brown
browns at iccgcc.decnet.ab.com
Mon Nov 19 06:29:17 AEST 1990
In article <1990Nov10.191840.21113 at clear.com>, rmartin at 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 at iccgcc.decnet.ab.com
Stan Brown, Oak Road Systems, Cleveland, Ohio, USA +1 216 371 0043
More information about the Comp.lang.c
mailing list