From owner-freebsd-chat Mon Jun 3 01:44:45 1996 Return-Path: owner-chat Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id BAA20558 for chat-outgoing; Mon, 3 Jun 1996 01:44:45 -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 BAA20552 for ; Mon, 3 Jun 1996 01:44:33 -0700 (PDT) Received: from allegro.lemis.de by diablo.ppp.de with smtp (Smail3.1.28.1 #1) id m0uQVFX-000QZOC; Mon, 3 Jun 96 10:44 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 KAA10660; Mon, 3 Jun 1996 10:39:38 +0200 Message-Id: <199606030839.KAA10660@allegro.lemis.de> Subject: Re: Indentation styles To: joerg_wunsch@uriah.heep.sax.de Date: Mon, 3 Jun 1996 10:39:38 +0200 (MET DST) Cc: chat@FreeBSD.ORG (FreeBSD Chat) In-Reply-To: <199606021410.QAA01867@uriah.heep.sax.de> from "J Wunsch" at Jun 2, 96 04:10:53 pm 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-chat@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk J Wunsch writes: > > As Greg Lehey wrote: > >>> The typografical rules say ~ 60 chars per line, everything else has to >>> be made two-column (a bit impractical for programs :). >> >> I've been thinking about this for a while, and I both agree and >> disagree. Yes, more than 60 chars per line become difficult to read, >> but I *do* use dual columns in my programs. There are these things >> called comments which I align in a column at the right (starting at >> column 50 by default). I don't like it when too many code lines run >> into the comment columns. > > ``comment columns'' are not really sanctioned by KNF. Look at > style(9) and into all the 4.4BSD-derived stuff, comments are usually > aligned at the indent level of the code. You should not comment each > and any line, it doesn't make the code better readable nor better > understandable. This is very much a matter of opinion. Obviously not *every* line requires a comment (lines containing a single { or } are pretty self-evident :-), but in general kernel code contains far too few comments. Where you put the comments is a matter of style, of course. > Instead, usually a larger block should be commented explaining its > purpose. This way, you won't have a need for two-column styled C > programs. Of course, if you put the comments where they belong, you wouldn't have a need for large comment blocks separated from their code. You can see this both ways. In fact, I see a need both for block comments and line comments. Greg