Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Apr 2002 10:13:59 -0500 (EST)
From:      Kenneth Culver <culverk@alpha.yumyumyum.org>
To:        Mike Barcroft <mike@FreeBSD.ORG>
Cc:        Matthew Dillon <dillon@apollo.backplane.com>, "M. Warner Losh" <imp@village.org>, <jake@locore.ca>, <dillon@FreeBSD.ORG>, <cvs-committers@FreeBSD.ORG>, <cvs-all@FreeBSD.ORG>
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
Message-ID:  <20020402100957.C45652-100000@alpha.yumyumyum.org>
In-Reply-To: <20020402024209.B19806@espresso.q9media.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> > 	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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020402100957.C45652-100000>