From owner-freebsd-chat Sun Jun 2 07:21:02 1996 Return-Path: owner-chat Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id HAA21254 for chat-outgoing; Sun, 2 Jun 1996 07:21:02 -0700 (PDT) Received: from irz301.inf.tu-dresden.de (irz301.inf.tu-dresden.de [141.76.1.11]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id HAA21229 for ; Sun, 2 Jun 1996 07:20:55 -0700 (PDT) Received: from sax.sax.de by irz301.inf.tu-dresden.de (8.6.12/8.6.12-s1) with ESMTP id QAA21497 for ; Sun, 2 Jun 1996 16:20:43 +0200 Received: by sax.sax.de (8.6.12/8.6.12-s1) with UUCP id QAA28393 for chat@FreeBSD.ORG; Sun, 2 Jun 1996 16:20:43 +0200 Received: (from j@localhost) by uriah.heep.sax.de (8.7.5/8.6.9) id QAA01867 for chat@FreeBSD.ORG; Sun, 2 Jun 1996 16:10:53 +0200 (MET DST) From: J Wunsch Message-Id: <199606021410.QAA01867@uriah.heep.sax.de> Subject: Re: Indentation styles To: chat@FreeBSD.ORG Date: Sun, 2 Jun 1996 16:10:53 +0200 (MET DST) Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: <199606020842.KAA15765@allegro.lemis.de> from Greg Lehey at "Jun 2, 96 10:42:09 am" X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E X-Mailer: ELM [version 2.4ME+ PL17 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-chat@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk 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. 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. /* * Determine i/o configuration for a machine. */ static void configure(dummy) void *dummy; { configure_start(); /* Allow all routines to decide for themselves if they want intrs */ enable_intr(); INTREN(IRQ_SLAVE); #if NCRD > 0 /* Before isa_configure to avoid ISA drivers finding our cards */ pccard_configure(); #endif ... #ifdef MFS_ROOT if (!mountroot) { mountroot = vfs_mountroot; /* XXX goes away*/ mountrootvfsops = &mfs_vfsops; /* * Ignore the -a flag if this kernel isn't compiled * with a generic root/swap configuration: if we skip * setroot() and we aren't a generic kernel, chaos * will ensue because setconf() will be a no-op. * (rootdev is always initialized to NODEV in a * generic configuration, so we test for that.) */ if ((boothowto & RB_ASKNAME) == 0 || rootdev != NODEV) setroot(); } #endif ... The only comment that fits your description is the short XXX one. You'll notice that the above fits pretty into an 80-column world, and it's far from being unreadable. (It still violates the style(9) requirement of making comments full sentences wherever possible and useful.) -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)