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: Kevin Brown <kevin@xxxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: K&R style (was Re: [PATCH] slight optimisation ...)
From: Trent Piepho <xyzzy@xxxxxxxxxxxxx>
Date: Fri, 17 Aug 2001 19:03:59 -0700 (PDT)

On Fri, 17 Aug 2001, Kevin Brown wrote:
> > 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

If you use cvs annotate you only get the most recent change to a line of
code.  I know I used this a lot to track down bugs.

> 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?

The idea is that when someone makes a change to a line of code, they are
CHANGING it.  That's why it is discouraged to commit something that
does nothing but reformat code.

> > 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.

You want to go thought every single line of code making sure that indent
actually made it look nicer than what was there before?

> 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.

Back in 1998 we decided against this, and CVS had just been started up and
there was a lot less code.  It would be an even worse idea now.  It's not like
not having the exact same indention style is some kind of huge problem.  If
half the code had 8 space indents and half had 2 spaces, or half was K&R
braces and half had that butt-ugly GNU stair-step style then maybe it would be
worth it.



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