Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2002:
[Freeciv-Dev] Re: A minor style issue.
Home

[Freeciv-Dev] Re: A minor style issue.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: A minor style issue.
From: Jason Short <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: 19 Dec 2002 13:32:03 -0500

On Thu, 2002-12-19 at 09:40, 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?

The "when in doubt, use indent -kr -..." part implies #2.  That's what I
always assumed was the standard (and I prefer it personally)...

jason



[Prev in Thread] Current Thread [Next in Thread]