[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]
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.
Message not available
- [Freeciv-Dev] Re: [PATCH] slight optimisation at client/packhand.c, Ross W. Wetmore, 2001/08/16
- [Freeciv-Dev] K&R style (was Re: [PATCH] slight optimisation ...), Justin Moore, 2001/08/17
- [Freeciv-Dev] Re: K&R style (was Re: [PATCH] slight optimisation ...), Kevin Brown, 2001/08/17
- [Freeciv-Dev] Re: K&R style (was Re: [PATCH] slight optimisation ...), Raimar Falke, 2001/08/17
- [Freeciv-Dev] Re: K&R style (was Re: [PATCH] slight optimisation ...), Trent Piepho, 2001/08/17
- [Freeciv-Dev] Re: K&R style (was Re: [PATCH] slight optimisation ...), Kevin Brown, 2001/08/17
- [Freeciv-Dev] Re: K&R style (was Re: [PATCH] slight optimisation ...), Trent Piepho, 2001/08/17
- [Freeciv-Dev] Re: K&R style (was Re: [PATCH] slight optimisation ...), Raimar Falke, 2001/08/19
- [Freeciv-Dev] Re: K&R style (was Re: [PATCH] slight optimisation ...), Kevin Brown, 2001/08/19
- [Freeciv-Dev] Re: K&R style (was Re: [PATCH] slight optimisation ...), Trent Piepho, 2001/08/19
|
|