> > I don't really know, but my feeling is that we should make the
> > minimal change, so that people can more easily see what has
> > *actually* changed.
> >
> > So... in that case I'd propose that you leave the existing code,
> > even where it is "wrong", but just try and make the new stuff be
> > "right".
> >
> > Does that sound sensible?
> >
> > What do others think?
> I've worked on projects which have had a mass reformatting to fit
> with some code standard, or new layout tool, and it's a nightmare.
> Trying to diff against the versions before the big change becomes
> useless, so trying to find code regressions becomes impossible.

Urgh! Been there...

<useless anecdote follows>

One time, when we "had" to change the code to match some prescribed format, 
what we actually did was fed all the code through an indenter (ISTR we used 
astyle in practice) with the rules set to get as close as possible to the 
desired format.

Did a reasonable job on the code, though messed up the comments a bit, 
particularly where the original authors had tried to lay out the comments with 
ASCII art and stuff...

We then compiled the "new" code and showed that the resulting stripped binary 
was identical to the "un-re-formatted" version. And that became our baseline.
All diffs were then against that code, in the new style.

It pretty much worked, aided considerably by the fact that the diff tool we 
were using was language sensitive, so ignored changes in the comments, allowing 
us to progressively "fix" the messed up comments and put them back as 
originally intended.

Though I'd not necessarily suggest anyone else go this path!

> Since then I try to keep the same formatting style as the old code.
> If you must, reformat the new/changed code only, but leave the old.


Selex ES Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 
A company registered in England & Wales.  Company no. 02426132
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.

fltk mailing list

Reply via email to