[Courses] Style (was Lesson Three: Basic Declarations&Expressions)

Telsa Gwynne hobbit at aloss.ukuu.org.uk
Sat Oct 19 17:56:34 EST 2002


On Mon, Oct 14, 2002 at 04:11:12PM -0700 or thereabouts, Akkana wrote:
> Jenn Vesperman writes:
> > I believe that the aspects which can be easily changed by a machine
> > (where the braces are, indentation levels) shouldn't be strictly
> > enforced in a project.
> 
> It depends on the project, of course; but if a project is managed
> by CVS or a similar version control system, then if you reformat that
> file for your own reading pleasure, then later cvs commit that file
> because you changed one line of code, as far as CVS is concerned you
> now own nearly every line of that file.  Also, if you reformat a
> file before working on it, cvs diff (even if you use the -w argument
> to ignore whitespace) may think you changed a lot more lines than
> you actually did.

Oh boy. Once or twice I have seen this happen in CVS-based
programs. And it sends other people who use cvs diff and 
friends round the twist.

> Much easier to just agree on a style and everybody learn to read
> and write that style (for files contained within the project).
> If you find it really hard to read the project's normal style,
> then sure, reformat in your tree; but do that at the risk of having
> to do extra work when checkin time comes.

Nod. And you have to do it every single time. If you forget once,
you'll end up with the situation above, where people get extremely
irate.

Telsa



More information about the Courses mailing list