Re: Symbol Name Length (Was: STL Memory leak?)
On Apr 16, 11:12 pm, Jorgen Grahn <grahn+n...@snipabacken.se> wrote:
On Thu, 9 Apr 2009 01:05:20 -0700 (PDT), James Kanze
<james.ka...@gmail.com> wrote:
[style rules]
As an absolute rule (which requires compelling justification
to violate), you should be consistent. If you do use "dest"
in one place, rather than "destination", then you should use
it everywhere---there should be no "destination" (nor "dst")
in the code.
That's actually the rule I hate and fear the most. Applied to
real life, it would mean I'd kiss the hand of everyone I meet,
because that's what I'll do if I meet the Pope.
Or that you shouldn't kiss the hand of the Pope:-).
Seriously, that's a bad analogy. The correct analogy would be
that every time I use a word in something that I write, I spell
it identically. Which in fact, I do.
If you intend "consistent" to mean "in similar situations, do
things the same way", then I'll agree strongly. Code which
switches indentation style, switches "voice" in the comments
and naming etc /at random/ is not fun to read. It tends to
have other problems as well -- it's a sign the programmer has
lost control over the code.
I think there typically is a bit of tolerance for local
variables within a function. Other than that, however, no. Any
given name should always be spelled the same way (and I'm not
that convinced that the tolerance within a function is
necessary).
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34