Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2001:
[Freeciv-Dev] Re: PATCH: AI cleanup Version 2
Home

[Freeciv-Dev] Re: PATCH: AI cleanup Version 2

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Petr Baudis <pasky@xxxxxxxxxxx>
Cc: Raahul Kumar <raahul_da_man@xxxxxxxxx>, Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>, freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: PATCH: AI cleanup Version 2
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 25 Nov 2001 21:16:44 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Sun, Nov 25, 2001 at 12:14:03PM +0100, Petr Baudis wrote:
> > If we do so we have to have:
> >  - to do it for all code
> yes, we just have to start somewhere :-)
> >  - guidelines first
> yes
> > 
> > Doing it at some part of the code based on your personal idea of how
> > does it look nice is not ok. We all have personal idea of how does the
> > code have to look but have to formalize this before we go to change
> > this. I really hope we can get a discussion going which will produce
> > such guidelines. Here are some questions for the start:
> > 
> >    * init vars
> >        int foo(struct city *punit)
> >        {
> >          int x=punit->x;
> >        } 
> > or
> >        int foo(struct city *punit)
> >        {
> >          int x;
> > 
> >          x=punit->x;
> >        }
> I think the second will be better, it's more clear.
> 
> >    * empty line after vars
> >        int x;
> >        x=3; 
> > or
> >        int x;
> > 
> >        x=3;
> Empty line, absolutely.
> 
> >    * comments
> >        x=3; /* assign 3 to x */ 
> > or
> >        /* assign 3 to x */
> >        x=3;
> I prefer first, unless the command or comment will be really long, or unless 
> we
> will describe larger part of code obviously.
> 
> >    * extra {} on iterates
> It would be good. At least to help editors to autoindent them etc. And for
> clarity too.

>    * spaces around assignment
>    * spaces around conditionals
>    * spaces around delimiters

Indent already takes care of this.

> I like this, it looks we will at last be able to get into sync and i
> will be able to produce patches which you will be willing accept
> :-). And the code will be readable enough to optimize it etc.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Transported to a surreal landscape, a young girl kills the first woman
  she meets and then teams up with three complete strangers to kill again."
    -- TV listing for the Wizard of Oz in the Marin Independent Journal


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