From owner-freebsd-hackers Tue May 28 02:14:15 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id CAA12424 for hackers-outgoing; Tue, 28 May 1996 02:14:15 -0700 (PDT) Received: from diablo.ppp.de (diablo.ppp.de [193.141.101.34]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id CAA12416 for ; Tue, 28 May 1996 02:14:07 -0700 (PDT) Received: from allegro.lemis.de by diablo.ppp.de with smtp (Smail3.1.28.1 #1) id m0uOKqk-000QZKC; Tue, 28 May 96 11:13 MET DST From: grog@lemis.de (Greg Lehey) Organisation: LEMIS, Schellnhausen 2, 36325 Feldatal, Germany Phone: +49-6637-919123 Fax: +49-6637-919122 Received: (grog@localhost) by allegro.lemis.de (8.6.9/8.6.9) id LAA23008 for hackers@freebsd.org; Tue, 28 May 1996 11:01:19 +0200 Message-Id: <199605280901.LAA23008@allegro.lemis.de> Subject: Indentation styles To: hackers@freebsd.org (FreeBSD Hackers) Date: Tue, 28 May 1996 11:01:19 +0200 (MET DST) X-Mailer: ELM [version 2.4 PL23] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk OK, I know source code indentation styles are a hot button, but I think I need to press it anyway. First, a question: is there a recommended FreeBSD indentation style? If not, I think there should be. 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. 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, indent(1) has a plethora of flags which can create just about any indentation style you like). That way, individuals can code in styles in which they feel comfortable, but when they submit code, it's in the canonical form. It would be an advantage, of course, to choose a canonical form which corresponds to the tastes of the majority. 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)? If there isn't a recommended FreeBSD indentation style, do you agree that there should be one? What should it be like? 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? Thoughts? Flames? Greg