[Freeciv-Dev] Re: PATCH: AI cleanup Version 2
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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
- [Freeciv-Dev] Re: Coding Guideline --- more variants, (continued)
- [Freeciv-Dev] Re: Coding Guideline --- more variants, Raimar Falke, 2001/11/28
- [Freeciv-Dev] Re: Coding Guideline --- more variants, Raimar Falke, 2001/11/28
- [Freeciv-Dev] Re: Coding Guideline --- more variants, Petr Baudis, 2001/11/28
- [Freeciv-Dev] Re: Coding Guideline --- more variants, Raahul Kumar, 2001/11/29
- [Freeciv-Dev] Re: Coding Guideline --- more variants, Petr Baudis, 2001/11/29
- [Freeciv-Dev] Re: Coding Guideline --- more variants, Reinier Post, 2001/11/29
- [Freeciv-Dev] Re: Coding Guideline --- more variants, Raimar Falke, 2001/11/29
- [Freeciv-Dev] Re: Coding Guideline --- more variants, Reinier Post, 2001/11/29
- [Freeciv-Dev] Re: Coding Guideline --- more variants, Daniel L Speyer, 2001/11/28
- [Freeciv-Dev] Re: Coding Guideline --- more variants, Raahul Kumar, 2001/11/29
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2,
Raimar Falke <=
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Raahul Kumar, 2001/11/26
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Raimar Falke, 2001/11/26
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Tony Stuckey, 2001/11/26
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Raimar Falke, 2001/11/26
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Raahul Kumar, 2001/11/24
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Petr Baudis, 2001/11/24
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Raahul Kumar, 2001/11/24
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Raimar Falke, 2001/11/25
- [Freeciv-Dev] Clearing your backlog, Raahul Kumar, 2001/11/25
- [Freeciv-Dev] Re: Clearing your backlog, Raimar Falke, 2001/11/25
|
|