[Fwd: Re: [Y-devel] Technical Notes]
Jason McKee toxic_shock at linux.wku.edu
Fri Feb 20 13:54:59 GMT 2004
Oddly enough you may not find yourself alone in this bold statement
On Thu, 19 Feb 2004, Matt Wilson wrote:
> D'oh! Reply-To: wasn't set :)
>
> On Thu, 2004-02-19 at 22:04, Nitin S Kumar wrote:
> > Hi
> >
> > You should probably use the Linux kernel coding style
> > guidelines as a start
> > (linux/Documentation/CodingStyle).
>
> I'd definitely have to disagree with that for a few reasons;
>
> * 8 character tabs (rather than 2 or 4, 2 being my personal pref.)
> * tabs (rather than spaces)
> * braces positioning
>
> The reason I mention the positioning of braces is that when you have
> lots of code, readability is a massive issue and;
>
> if ( .. ) {
> // do something
> }
>
To me this syntax style is antiquated.. flame on for that but its simply
not as readable as if(..)
{
//my code here
}
putting that extra line between the if and the first line of code makes a
big difference in readability for some people (i.e. me)
if(x==4 && y == 4 && z == 4){
callSomeFunctionWithArgs(x,y,z);
callAnotherFunctionIJustInvented(zz,tt);
}
as compared to
if(x==4 && y == 4 && z == 4)
{
callSomeFunctionWithArgs(x,y,z);
callAnotherFunctionIJustInvented(zz,tt);
}
This isn't going to make Y run any smoother or be more widely accepted..
it just seems to be a point of contention among some developers as to
which is better(read: more readable). Obviously neither one of them is
any more correct than the other. Making a clear space distinction between
the condition and the resulting executed code is IMHO why developers such
as myself find the second method more attractive than the standard.
To semi-contradict myself, I often do the following when callin a function
with many args.
callMyThirdImaginaryFunction(lots,
of,
parameters,
are,
more,
readable,
when,
put,
on,
multiple,
lines);
word wrap and not being able to see all the args at once in context of the
function being called can be a pain when debugging or digesting code
Although calling many functions repeatedly in this manner can really
detract from the readability of the code, so its really a judgement call
from the developeres standpoint.
Just some babblings about style... hopefully not offending anyone, but
just throwing out some reason behind the "madness" that is "next line
opening curlies."
-J
> takes much longer to read (in terms of skimming through source looking
> for something) than the alternative;
>
> if ( ... )
> {
> // do something
> }
>
> Likewise for other constructs; 'for, 'while, 'do' and function
> definitions.
>
> Though I'm sure I'll receive some flame material for saying that :P
>
> > Nitin
> >
> >
> > > --- Jay Sprenkle <cupycake_jay at yahoo.com> wrote:
> > > >
> > > > --- Dave Jarvis <djarvis at invoqsystems.com> wrote:
> > > > >
> > > > > I guess the main point I was trying to make,
> > > which
> > > > > got mired in mucky
> > > > > details, was that it is better to step in at the
> > > > > start of a project with
> > > > > a list of guidelines and styles, rather than
> > > > trying
> > > > > to get everyone to adopt it later.
> > > >
> > > > snip
> > > >
> > > > >
> > > > > Like I said, it's easy to get mired in a myriad
> > > of
> > > > > details -- the main
> > > > > point I'm trying to make is be consistent.
> > > >
> > > > I've had something similar on everything I've been
> > > > on.
> > > > I don't agree with you on one or two small details
> > > > but IMHO a good idea. Since you can't compel
> > > > agreement why don't you make up a document with
> > > your
> > > > exact proposed standards and put it up for
> > > comments
> > > > and adopt what the concensus agrees on? Your first
> > > > email sounds like a good start.
> > > >
> > > >
> > > >
> > > > __________________________________
> > > > Do you Yahoo!?
> > > > Yahoo! Mail SpamGuard - Read only the mail you
> > > want.
> > > > https://antispam.yahoo.com/tools
> > > >
> > > > _______________________________________________
> > > > Y-devel mailing list
> > > > Y-devel at www.y-windows.org
> > > > https://www.y-windows.org/mailman/listinfo/y-devel
> > >
> > >
> > > __________________________________
> > > Do you Yahoo!?
> > > Yahoo! Mail SpamGuard - Read only the mail you want.
> > > https://antispam.yahoo.com/tools
> > >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Mail SpamGuard - Read only the mail you want.
> > https://antispam.yahoo.com/tools
> >
> > _______________________________________________
> > Y-devel mailing list
> > Y-devel at www.y-windows.org
> > https://www.y-windows.org/mailman/listinfo/y-devel
>
> --
> https://www.mattsscripts.co.uk/
> - A great source for free CGI and stuff
>
> The quality of a blow-job is determined by the length of sheet you have to
> pull out of your ass.
>
>
> _______________________________________________
> Y-devel mailing list
> Y-devel at www.y-windows.org
> https://www.y-windows.org/mailman/listinfo/y-devel
>
More information about the Y-devel mailing list
2026 © www.Y-Windows.Org - All Rights Reserved