Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2003:
[Freeciv-Dev] Re: (PR#4298) Coding style
Home

[Freeciv-Dev] Re: (PR#4298) Coding style

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: a-l@xxxxxxx
Subject: [Freeciv-Dev] Re: (PR#4298) Coding style
From: "Mike Kaufman" <kaufman@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 25 May 2003 10:35:22 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Sun, May 25, 2003 at 09:20:02AM -0700, a-l@xxxxxxx wrote:
> "Mike Kaufman" <kaufman@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> 
> > o I only glanced at the code, but it looks like there are a few places that
> >   need to be restylified.
> 
> Ok, in some cases I divert.. I think A looks more clear than B, see
> below. But if you don't like it, I can just follow the styleguide
> stringently. No problem.
> 
> 
> A)
>        if   (x < 0 && !L_updated)   L_scheduled = TRUE;
>   else if   (x > 0 && !R_updated)   R_scheduled = TRUE;
>        if   (y < 0 && !T_updated)   T_scheduled = TRUE;
>   else if   (y > 0 && !B_updated)   B_scheduled = TRUE;
> 
> B)
>   if (x < 0 && !L_updated) {
>     L_scheduled = TRUE;
>   } else if (x > 0 && !R_updated) {
>     R_scheduled = TRUE;
>   if (y < 0 && !T_updated) {
>     T_scheduled = TRUE;
>   } else if (y > 0 && !B_updated) {
>     B_scheduled = TRUE;
>   }

hmm, well I think that B) should actually be:

   if (x < 0 && !L_updated) {
     L_scheduled = TRUE;
   } else if (x > 0 && !R_updated) {
     R_scheduled = TRUE;
   }

   if (y < 0 && !T_updated) {
     T_scheduled = TRUE;
   } else if (y > 0 && !B_updated) {
     B_scheduled = TRUE;
   }

I too have issues with some unnecessary brackets, but the style guide is a
good compromise for everyone, follow it.

-mike



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