Re: How to name variables in a program?
- From: cri@xxxxxxxx (Richard Harter)
- Date: Sat, 28 May 2005 05:36:35 GMT
On Sat, 28 May 2005 05:18:01 +0200, "SerGioGio" <nospam> wrote:
>Hello,
>
>Having a strong convention for naming your variables in your program is an
>important issue often overlooked.
>Can anyone point me to a good source on the web dealing with this issue?
I read a study once that said that the important thing was to use a
standardized set of abbreviations and naming conventions. The study
had actual metrics for what that might be worth. My take is that
names shouldn't be too long, i.e., names longer than ordinary words
are obfuscation. (Indeed any name longer than "obfuscation" is too
long.) Abbreviations are fine, e.g., ptr for pointer, provided (a)
they are evocative and (b) there are no variants.
The odd thing is that natural languages are defined by their
vocabulary whereas computer languages are defined by their grammar.
That is, one cannot understand a natural language, e.g., English,
without knowing the meaning of a good number of words, not counting
words such as "have", "had" and "to" that are part of the grammatical
superstructure. In computer languages the grammatical structure terms
(keywords) are all there is; each program makes us its own
idiosyncratic dictionary.
Richard Harter, cri@xxxxxxxx
http://home.tiac.net/~cri, http://www.varinoma.com
Save the Earth now!!
It's the only planet with chocolate.
.
- References:
- How to name variables in a program?
- From: SerGioGio
- How to name variables in a program?
- Prev by Date: Re: Creationist software engineering? A frightening possibility!
- Next by Date: Re: How to name variables in a program?
- Previous by thread: Re: How to name variables in a program?
- Next by thread: Re: How to name variables in a program?
- Index(es):
Relevant Pages
|