Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Jan 1999 08:34:00 +0000
From:      Brian Somers <brian@Awfulhak.org>
To:        Andrew Kenneth Milton <akm@zeus.theinternet.com.au>
Cc:        julian@whistle.com (Julian Elischer), mike@smith.net.au, dillon@apollo.backplane.com, archie@whistle.com, nate@mt.sri.com, current@FreeBSD.ORG
Subject:   Re: btokup().. patch to STYLE(9) (fwd) 
Message-ID:  <199901290834.IAA00519@keep.lan.Awfulhak.org>
In-Reply-To: Your message of "Fri, 29 Jan 1999 13:09:55 %2B1000." <199901290309.NAA25300@zeus.theinternet.com.au> 

next in thread | previous in thread | raw e-mail | index | archive | help
> +----[ Julian Elischer ]---------------------------------------------
> | yeah but not a SINGLE person has said to not commit the patch to style(9)
> | so I'm going to do it later tonight..
> | (It doesn't make extra braces MANDATORY but it does ALLOW them.)
> | 
> | julian
> | (if this doesn't bring some NEYs I'll be amazed..)
> 
> Only from people who don't seem to cut code in the real world.
[.....]
> There are only disadvantages to leaving them out.

I missed the original suggestion, but I have an objection to 
*insisting* on extra braces (*allowing* is absolutely fine) - 
such as gcc-2.8.1's idea that

  if (x)
    if (y)
      blah1
    else
      blah2

should have braces around the inner if/else.  As Nate has already 
pointed out, it's not the compilers job to check that your style is 
GNU flavoured.

I think this sort of warning should be removed from the system 
compiler rather than changing all software to add the extraneous 
braces.


My argument is that this sort of thing gets out of hand.  I've seen 
things such as

  if (((a == b) || (c == d)))

where a, b, c & d are just simple variables - there are so many 
redundant brackets that you have to double-check that there isn't 
some weird grouping....

Also, with non-k&r style code, you can end up with so many redundant 
braces that you can't see enough context on your screen to know what 
the code is doing:

  if (a)
  {
    expr1
  }
  else if (b)
  {
    expr2
  }
  else
  ....

But where do you draw the line in style(9) ?  Dunno.

> -- 
> Totally Holistic Enterprises Internet|  P:+61 7 3870 0066   |  Andrew
> The Internet (Aust) Pty Ltd          |  F:+61 7 3870 4477   |  Milton
> ACN: 082 081 472                     |  M:+61 416 022 411   |72 Col .Sig
> PO Box 837 Indooroopilly QLD 4068    |akm@theinternet.com.au|Specialist

-- 
Brian <brian@Awfulhak.org> <brian@FreeBSD.org> <brian@OpenBSD.org>
      <http://www.Awfulhak.org>;
Don't _EVER_ lose your sense of humour !



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901290834.IAA00519>