From owner-cvs-all Sun Jul 22 1:19: 9 2001 Delivered-To: cvs-all@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 9AE7837B401; Sun, 22 Jul 2001 01:19:00 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id SAA20785; Sun, 22 Jul 2001 18:18:20 +1000 Date: Sun, 22 Jul 2001 18:15:09 +1000 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: Paul Richards Cc: Ruslan Ermilov , Bruce Evans , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/share/man/man9 style.9 In-Reply-To: <517230000.995763034@lobster.originative.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, 22 Jul 2001, Paul Richards wrote: > >> What I was talking about was: > >> if (mylevel == SLC_DEFAULT) { > >> slctab[(int)func].current.flag = flag; > >> slctab[(int)func].current.val = val; > >> flag |= SLC_ACK; > >> } else if (hislevel == SLC_CANTCHANGE && > >> mylevel == SLC_CANTCHANGE) { > > Why is this good style? Because it gives uniform indentation which is never >= the next full indentation level (== is especially hard to read). > I find that much harder to read than the case where the tests are lined up > i.e. > > } else if (hislevel == SLC_CANTCHANGE && > mylevel == SLC_CANTCHANGE) { Everything is easier to read when it is outdented to column 0 and complicated surrounding context is removed :-). A real example would look more like: if (foo(verylongarg1, verylongarg2, verylongarg3) == SLC_CANTCHANGE) { flag |= SLC_ACK; } else if (thisfunctionnameistoolongforitsowngood(arg1, arg2) == 1) { flag |= SLC_AGH; } else if (hislevel == SLC_CANTCHANGE && mylevel == SLC_CANTCHANGE) { slctab[(int)func].current.flag = flag; } (More normal examples would start in column 48 and not need such long names to be so ugly.). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message