Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: [PATCH] slight optimisation at client/packhand.c
Home

[Freeciv-Dev] Re: [PATCH] slight optimisation at client/packhand.c

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] slight optimisation at client/packhand.c
From: Trent Piepho <xyzzy@xxxxxxxxxxxxx>
Date: Thu, 16 Aug 2001 16:09:05 -0700 (PDT)

On Thu, 16 Aug 2001, Gaute B Strokkenes wrote:
> 
> I believe at the beginning is the K&R way.  Someone may wish to check.

I don't think it is standard.  The option for GNU indent that controls it,
-bbo, didn't even appear before indent 2.x.

Since the freeciv coding standard predates indent 2.x, I think it's safe to
say that no one meant to make a rule one way or the other.  I know I didn't at
the time the standard was made.

> On a pragmatical level, I like being able to quickly scan through an
> if-statement and see what the conditionals are and how they are
> related.  That's a lot easier if the logical operators are right at
> the beginning rather than all the way to the right of the screen.

I like them at the end, so that all the clauses line up better, instead of the
first one offset to the left of the other.  It also makes it easier to tell
when you read line by line that the current line isn't done yet.

> > and it's more common that way in the code.
> 
> I'm not so sure about that.  I think it depends on how old that part
> of the code is.

I counted, at the end outnumbers at the beginning by about 745 vs 656.  Which
is a pretty even split.  So I suppose either one should be ok, no need to
re-write code just to change it.  But then it was always policy not to change
code just to fix indention or style.

In the linux kernel, at the end outnumbers the beginning by 7767 to 2210.
So at the end is definitely the more popular method.



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