Re: Commenting style?
Timo Geusch wrote:
James Kanze wrote:
clcppm-poster@this.is.invalid wrote:
On 13 Jan 2007 15:59:57 -0500, Dave Harris wrote:
I think trying to line up comments with tabs or spaces is a mugs
game. Including things like:
int x; // Some value.
std::vector<int> table; // Some other value.
It's just too much trouble to maintain. [...] And although it
looks prettier I don't believe it is any easier to read.
I hope this won't create an uproar but one shouldn't underestimate
the good effects of pleasure (I mean of the spirit :-)). Our mood
does affect our activities, especially the mental ones.
Agreed. I'd rather maintain esthetically pleasing code.
I think it also passes an important message: that the programmer
cared about the code he was writing. (But not aligning things
doesn't mean that the programmer doesn't care. If it's aligned,
he probably cared; if it's not, you don't know, unless there are
other signs---and there almost always are, if he did care.)
How often do you see someone doing something they really care about in
a sloppy fashion?
Never.
While code that looks estetically pleasing to me may not look the same
to you - after all, countless flamewars have been fought about the most
important question ever in the proramming universe, namely where the
curly braces go - at least a consistent layout with a minimum of
formatting and well tought-out variable names would suggest that the
original author of the code cared about what e was doing.
Certainly. And there are two philosophies regarding the
alignment of opening comments. I like them aligned; Dave Harris
doesn't think it matters. Both are valid viewpoints, just like
the position of the opening brace. If you see them aligned, you
know that the programmer cared. You also know that he thought
it mattered. If you don't see them aligned, you don't know
whether it was because he didn't care, or because he simply
didn't feel that it mattered.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orientie objet/
Beratung in objektorientierter Datenverarbeitung
9 place Simard, 78210 St.-Cyr-l'Icole, France, +33 (0)1 30 23 00 34
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]