Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Jan 1999 23:02:23 -0500
From:      Christopher Masto <chris@netmonger.net>
To:        Bruce Evans <bde@zeta.org.au>, current@FreeBSD.ORG
Subject:   Re: btokup().. patch to STYLE(9) (fwd)
Message-ID:  <19990128230223.A1973@netmonger.net>
In-Reply-To: <199901290326.OAA22743@godzilla.zeta.org.au>; from Bruce Evans on Fri, Jan 29, 1999 at 02:26:51PM %2B1100
References:  <199901290326.OAA22743@godzilla.zeta.org.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jan 29, 1999 at 02:26:51PM +1100, Bruce Evans wrote:
> >My mail system appears to have accidentally deleted your excellent and
> >well-considered reasons for not allowing style(9) to say "it's OK to
> >use extra braces or parenthesis when it makes your code more
> >comprehensible".
> 
> Perhaps it is in some of your backups from 5 years ago.
> 
> >Perhaps you could repeat it?
> 
> style(9) is supposed to document KNF.  It is not supposed to document
> best coding practices, julian's preferences or bde's preferences.

So kernel code should not follow best coding practices (remember, the
current style guide says "Don't use parenthesis unless they're
required for precedence").  It should be a _restriction_ on FreeBSD
code (and not just kernel code:

     This file specifies the preferred style for kernel source files in the
     FreeBSD source tree.  It is also a guide for preferred user land code
     style.

) that parenthesis are not allowed, even if they aid readability and
maintainability, just because they are not required for precedence.

The document is in error one way or the other.  It calls itself a
"style guide", starts out using the word "preferred", and contains
lots of "dos" and "don'ts".  If it is going to make coding style
suggestions, they should be useful suggestions.  "Parenthesis are
allowed to make your code easier to read, even if not strictly
required by the compiler" is a much more useful suggestion than what
is currently there.  If it's not making coding suggestions, then it
should not use words like "do" and "don't", and the introduction
should be rewritten.  And in my opinion, it should then be deleted
because it would be of no value.

Not everyone comes to FreeBSD with the same background and
expectations.  People WILL read a document called "FreeBSD Style
Guide" and expect that it DOES contain "best coding practices", or at
least the preferences of the FreeBSD core team.  Such a document
should either not be provided, peppered with disclaimers about its
purpose, or (IMHO preferably) contain correct recommendations.

The inertia here sometimes is truly astounding.  The apparent
infallability of code and historical documents anyone tries
to update suggests that the Pope was involved with CSRG.

Encouraging unreadable code is something I find highly questionable.
-- 
Christopher Masto        Director of Operations      NetMonger Communications
chris@netmonger.net        info@netmonger.net        http://www.netmonger.net

    "Good tools allow users to do stupid things." -- Clay Shirky

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?19990128230223.A1973>