[Freeciv-Dev] Re: A minor style issue.
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Thu, Dec 19, 2002 at 04:32:24PM +0100, Davide Pagnin wrote:
> On Thu, 2002-12-19 at 16:24, Mike Kaufman wrote:
> > On Thu, Dec 19, 2002 at 02:40:48PM +0000, Gregory Berkolaiko wrote:
> > > Our coding style guideline gives conflicting signal wrt use of
> > > spaces between "if" and the condition:
> > >
> > > if(ptr == NULL)
> > >
> > > vs.
> > >
> > > if (ptr == NULL)
> > >
> > > There are a couple of relevant bits of CodingStyle:
> > >
> > > ==========
> > > - spaces are inserted before and after operators ("int i, j, k;"
> > > instead of "int a,b,c;" and "if (foo <= bar) c = a + b;" instead
> > > of "if(foo<=bar) c=a+b;")
> > > ==========
> > >
> > > and
> > >
> > > ==========
> > > - Comments in conditionals. If you need a comment to show program flow,
> > > it should be below the if or else:
> > >
> > > if(is_barbarian(pplayer)) {
> > > x++;
> > > ==========
> > >
> > > Should we clearly inforce one or the other?
> >
> > no.
> >
> > -mike
>
> One of the two MUST be wrong (I'm talking about the CodyingStyle
> examples) we have two choices:
> - remove first example
> - correct second example
> My opinion is to put the white space in the between, always, thus
> correct the second example.
I agree.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"Only one human captain has ever survived battle with the Minbari
fleet. He is behind me. You are in front of me. If you value your
lives, be somewhere else."
-- Ambassador Delenn, "Severed Dreams," Babylon 5
|
|