Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: K&R style (was Re: [PATCH] slight optimisation ...)
Home

[Freeciv-Dev] Re: K&R style (was Re: [PATCH] slight optimisation ...)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Trent Piepho <xyzzy@xxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: K&R style (was Re: [PATCH] slight optimisation ...)
From: Kevin Brown <kevin@xxxxxxxxxxxxxx>
Date: Fri, 17 Aug 2001 17:33:26 -0700

Trent Piepho <xyzzy@xxxxxxxxxxxxx> wrote:
> On Fri, 17 Aug 2001, Kevin Brown wrote:
> > except for deciding which arguments to pass to indent.  Seems to me
> > that we should decide on one and then run the entire source tree
> > through indent with the appropriate arguments.  Afterwards, it doesn't
> 
> That's really not a good idea.  It completly messes up the CVS
> history, as you would no longer be able to tell when a line of code
> was written.  

You can't retrieve the entire history of a line from CVS?  If it can
give you the origination of a line of code through multiple patches
and such, then I don't see why this is an issue.  If not, then it
sounds like CVS would be of limited usefulness here anyway, since once
someone makes a change to a line of code, its origination information
is lost, right?

> You also get this huge commit in CVS that's twice as big as the
> entire source code.  

Disk is cheap.  REALLY cheap.  And yeah, you do get that huge commit,
but only once.

> indent is also not perfect, sometimes programmers have carefully
> spaced tables or comments so that they line up and then indent
> messes that up.

There are ways to give hints to indent.  The manpage says that boxed
comments are left alone, so there's a way to preserve the formatting
of comments.  It also says that you can put blocks that you don't want
it to touch between /* *INDENT-OFF* */ and /* *INDENT-ON* */.  Issues
like this can be cleared up with further patches once the indent run
has been committed, for anything that the CVS maintainers miss.

Given all the discussion that the issue of style has generated so far,
and will probably continue to generate in the future, it seems to me
that it's worth doing the indent run once and taking the initial hit
against some of the nicely-formatted stuff in order to settle the
problem of inconsistent formatting of the code once and for all.  It's
also a good long-run strategy because patch submitters will have one
less nitpicky thing to worry about.


-- 
Kevin Brown                                           kevin@xxxxxxxxxxxxxx

    It's really hard to define what "unexpected behavior" means when you're
                       talking about Windows.


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