From owner-freebsd-hackers Tue May 28 03:42:44 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id DAA16876 for hackers-outgoing; Tue, 28 May 1996 03:42:44 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id DAA16869 for ; Tue, 28 May 1996 03:42:30 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.12/8.6.9) id UAA13366; Tue, 28 May 1996 20:35:53 +1000 Date: Tue, 28 May 1996 20:35:53 +1000 From: Bruce Evans Message-Id: <199605281035.UAA13366@godzilla.zeta.org.au> To: grog@lemis.de, hackers@freebsd.org Subject: Re: Indentation styles Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >First, a question: is there a recommended FreeBSD indentation style? Yes. See style.9 in -current or /usr/src/admin/style/style in 4.4BSD. >Now, my problem: I frequently modify other people's code, which >sometimes causes me problems in reading, simply because the >indentation varies so much from the indentation that my tools and I >use. Frequently, I just give up and run the whole source through >indent(1). The resulting modifications work (usually), but it's >difficult to pass them back to the original author as diffs. Don't use indent on other peoples code. >Therefore, my suggestion: if FreeBSD doesn't have a canonical >indentation style, it should get one. The style should be >reproducible with indent(1). (For those of you who don't know, BSD indent is too broken to produce BSD style :-(. It can only produce an approximation that looks OK but has too many differences for automatic use. >If there is already a recommended FreeBSD indentation style, can it be >reliably produced with indent(1)? If not, what do people think about >modifying it to a (closely similar) form which can be created with >indent(1)? indent(1) should be changed, not the style. Otherwise 200MB of current sources that sort of have the correct style would have the wrong style. >Finally, a restriction. Indent style can, in some cases, influence >coding style: for example, if you choose an indent of 8 and indent >braces 8 characters and the contents of a block another 8 spaces, >you'll soon run out of margins. Even if you only indent a single 8 >characters, you'll end up writing different code from people running >smaller indents. Does this matter? 8 is too much but we're stuck with it. There is something to be said for the discipline required to minimise nesting. Don't right code like this: { { { { { { { { { /* * Com- * men- * ts * are * hard * to * fit * bet- * wee- * n * col- * umns * 72 * and * 80. */ { /*->*/ { /*->*/ /* Some people's xterms are too wide. */ Bruce