From owner-freebsd-current Thu Jan 28 01:51:17 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id BAA18164 for freebsd-current-outgoing; Thu, 28 Jan 1999 01:51:17 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id BAA18159 for ; Thu, 28 Jan 1999 01:51:13 -0800 (PST) (envelope-from grog@freebie.lemis.com) Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by allegro.lemis.com (8.9.1/8.9.0) with ESMTP id UAA24323; Thu, 28 Jan 1999 20:21:07 +1030 (CST) Received: (from grog@localhost) by freebie.lemis.com (8.9.2/8.9.0) id UAA09037; Thu, 28 Jan 1999 20:21:06 +1030 (CST) Date: Thu, 28 Jan 1999 20:21:06 +1030 From: Greg Lehey To: Bruce Evans Cc: luigi@labinfo.iet.unipi.it, current@FreeBSD.ORG, peter.jeremy@auss2.alcatel.com.au Subject: Nesting levels (was: indent(1) and style(9) (was: btokup() macro in sys/malloc.h)) Message-ID: <19990128202106.I8473@freebie.lemis.com> References: <199901280939.UAA30919@godzilla.zeta.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.1i In-Reply-To: <199901280939.UAA30919@godzilla.zeta.org.au>; from Bruce Evans on Thu, Jan 28, 1999 at 08:39:03PM +1100 WWW-Home-Page: http://www.lemis.com/~grog Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thursday, 28 January 1999 at 20:39:03 +1100, Bruce Evans wrote: >> not speaking about vinum, but to me, the indentation of 8 char and >> line length of 80 chars are almost mutually exclusive. >> >> See e.g. tcp_input.c ip_input.c and many network device drivers as >> an example -- basically all places where, for efficiency reasons, >> the code tries to expand in-line various block, the depth of >> indentation pushes everything to the right end leaving only 20-30 >> useful chars per line. > > See the Linux style guide Wave a red rag at a bull? > (linux/Documentation/CodingStyle) for strong opinions about this: > "if you need more than 3 levels of indentation, you're screwed > anyway, and should fix your program". I think this is the bottom line. If you're using 8 character indents, then yes, you're screwed. If you're using Microsoft and trying to write clever shell scripts, you're screwed too. Your tools limit what you can do. I believe that, in the matter of indentation, style(9) limits legibility to a point where you really are screwed if you have multiple indentation. But it's not because the code's bad. Greg -- See complete headers for address, home page and phone numbers finger grog@lemis.com for PGP public key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message