From owner-cvs-all Tue Apr 2 7:14:43 2002 Delivered-To: cvs-all@freebsd.org Received: from mailhub.yumyumyum.org (dsl092-171-091.wdc1.dsl.speakeasy.net [66.92.171.91]) by hub.freebsd.org (Postfix) with SMTP id 9448037B41D for ; Tue, 2 Apr 2002 07:14:32 -0800 (PST) Received: (qmail 45698 invoked from network); 2 Apr 2002 15:13:59 -0000 Received: from dsl092-171-091.wdc1.dsl.speakeasy.net (66.92.171.91) by dsl092-171-091.wdc1.dsl.speakeasy.net with SMTP; 2 Apr 2002 15:13:59 -0000 Date: Tue, 2 Apr 2002 10:13:59 -0500 (EST) From: Kenneth Culver To: Mike Barcroft Cc: Matthew Dillon , "M. Warner Losh" , , , , Subject: Re: cvs commit: src/sys/i386/i386 critical.c src/sys/i386/include cpufunc.h critical.h src/sys/i386/isa apic_vector.s icu_vector.s src/sys/kern kern_fork.c kern_proc.c kern_switch.c src/sys/alpha/alph In-Reply-To: <20020402024209.B19806@espresso.q9media.com> Message-ID: <20020402100957.C45652-100000@alpha.yumyumyum.org> 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 > > if (a) { > > x; > > y; > > } else > > /* > > * HITHERE! > > */ > > b; > > This looks better with proper 8 character tabs. I think in KNF extra > braces are normally used in situations like this, but this is an edge > case. 8 character tabs? why use tabs at all? That requires an engineer/programmer to set that in an editor, and a lot of people don't like having tabs that are that large... I just use spaces because then my code will look the same as when I wrote it no matter what editor is used, and no matter what the tabs are set to. > > Which actually exists in the FFS code somewhere. Unbelievable. > > This business about declaration placement is really in the eye of the > > beholder. I'm sure the older people remember compilers breaking on > > sub-block declarations, but I have not personally seen that sort of > > breakage in many years. It is also easy to go too far the other way, > > and I will readily admit that my 'mask' declaration in three side-by-side > > sub-blocks was kind of silly. But, that said, it made far more sense to > > move it up one level rather then move it up all the way to the top of > > the procedure. I can't tell you how difficult it is to read and > > understand a procedure that makes 30 declarations at the top, many of > > which are used just once or twice somewhere deeply nested in the middle. > > > > Yuch. It's as though code modularity ends at the procedure boundary > > for a lot of people. > > > > I'm not saying that people can't do cleanups of my code, but at the > > very least if it is something I committed recently you should email me > > a heads up and make sure the file isn't still under active development. > > And I *DO* draw the line. I'll suffer splitting assignments off of > > the declaration, the removal or addition of blank lines between > > comments and code, and I'll even suffer the absolutely ridiculous blank > > line placed after a procedure's open brace when a procedure has no > > declarations. BUT, I draw the line at moving variable declarations > > around or removing braces that were emplaced to make the code more > > readable. > > C99 adds even more ways to obfuscate code (for instance, allowing > variable declarations anywhere in a code block, not just at the top). Yeah, I'm not sure why they did that, it has always be considered bad style to just randomly declare a variable in the middle of code. I can understand doing it at the beginning of a block of whatever kind although personally I avoid doing that too... > Best regards, > Mike Barcroft > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe cvs-all" in the body of the message > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message