Delight

Benji Smith dlanguage at benjismith.net
Fri Sep 26 22:51:21 PDT 2008


0ffh wrote:
> Bill Baxter wrote:
>> Pro spaces argument: "You have to modify the file to reindent, but at
>> least everyone sees the same thing and there are no surprises".   The
>> Pragmatist's argument.
> 
> Well, yes, it just works! I've done the odd bit of coding in Python, and 
> the
> first thing I learned was never touch anybode elses code before first doing
> a "convert tabs to spaces" and then activate "insert spaces for tabs".
> And I did never, ever again have any trouble with indentation whatsoever.
> 
> regards, frank

The trouble with that is, if you work on a team, and you check your 
changes back into the repository, you'll generate a lot of worthless 
diffs, and people will have a more difficult time following the revision 
history.

When I work on a team with other people, I always adapt my indentation 
and bracing style to the code I'm currently working on. And I never 
change a line of code someone else wrote, unless I'm making a semantic 
change.

My own modules are written with my favorite coding style, but I don't 
mind slumming in someone else's style for the sake of consistency.

I used to work with a guy who regularly checked out the whole source 
tree, ran it through a pretty-printer, with his favorite code style, and 
then checked the changes back in. His stupid reformatting projects drove 
pretty much everyone crazy, since we had a hell of a time making sense 
of our diffs.

--benji


More information about the Digitalmars-d-announce mailing list