From owner-freebsd-current Thu Jan 28 20:02:33 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA13606 for freebsd-current-outgoing; Thu, 28 Jan 1999 20:02:33 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from cheddar.netmonger.net (cheddar.netmonger.net [209.54.21.140]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA13594 for ; Thu, 28 Jan 1999 20:02:30 -0800 (PST) (envelope-from chris@cheddar.netmonger.net) Received: (from chris@localhost) by cheddar.netmonger.net (8.8.8/8.8.8) id XAA03888; Thu, 28 Jan 1999 23:02:23 -0500 (EST) Message-ID: <19990128230223.A1973@netmonger.net> Date: Thu, 28 Jan 1999 23:02:23 -0500 From: Christopher Masto To: Bruce Evans , current@FreeBSD.ORG Subject: Re: btokup().. patch to STYLE(9) (fwd) References: <199901290326.OAA22743@godzilla.zeta.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.1i In-Reply-To: <199901290326.OAA22743@godzilla.zeta.org.au>; from Bruce Evans on Fri, Jan 29, 1999 at 02:26:51PM +1100 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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