Long names are doom ? 
Author Message
 Long names are doom ?

 Hi All,

  Anybody use variables/names longer than 31 character
and finds it really useful ?

Then please respond  why, where, when.
I have folks here in comp.lang.fortran who will die claiming that they

- "never seen a well written, legible program
  that uses any identifiers longer than 18-20 characters..".
- "long variables names are *hard* to read.  And, you have to
  read though all the characters of every instance of them...".
- "it degrades the legibility of a program to use identifiers that
  can't be easily remembered...."

As a result, despite 90% of computer languages have long, very
long or 'infinite' identifiers, fortran folks seems plan to stay
with their 6...aargh ...sorry this was just not far ago... 31 character
limit intil year 3000.

cheers



Tue, 11 Nov 2003 10:02:50 GMT  
 Long names are doom ?

Quote:
>   Anybody use variables/names longer than 31 character
> and finds it really useful ?

Yes, I do occasionally use very long identifiers.  Normally, I do so when I
am using a lot of identifiers according to a set naming convention.  For
example, I might, in a Swing GUI application, declare an Action subclass
called:

    viewPreferencesGeneralOptionsAction

That's 35 characters.  If that's really my menu structure (that is, view |
prefs | general | options) then I really want to use that variable name.
This is not to say that I very frequently use such names, but when I need to
for consistency, I'd really hate for the language to stand in my way.

Quote:
> - "never seen a well written, legible program
>   that uses any identifiers longer than 18-20 characters..".

Mostly true, but I disagree with the absolute statement.

Quote:
> - "long variables names are *hard* to read.  And, you have to
>   read though all the characters of every instance of them...".

Definitely true.

Quote:
> - "it degrades the legibility of a program to use identifiers that
>   can't be easily remembered...."

Definitely true.

For those reasons, I don't agree with regularly using long variable names
unless, like in the example above, they make intuitive sense and there's
some systematic reason for that name choice.

Chris Smith



Tue, 11 Nov 2003 10:25:57 GMT  
 Long names are doom ?

Quote:

>  Hi All,

>   Anybody use variables/names longer than 31 character
> and finds it really useful ?

> Then please respond  why, where, when.
> I have folks here in comp.lang.fortran who will die claiming that they

> - "never seen a well written, legible program
>   that uses any identifiers longer than 18-20 characters..".
> - "long variables names are *hard* to read.  And, you have to
>   read though all the characters of every instance of them...".
> - "it degrades the legibility of a program to use identifiers that
>   can't be easily remembered...."

> As a result, despite 90% of computer languages have long, very
> long or 'infinite' identifiers, fortran folks seems plan to stay
> with their 6...aargh ...sorry this was just not far ago... 31 character
> limit intil year 3000.

I regularly use names longer than 31 characters, but it's in large part
due to naming conventions in force at work (every function name must
start with the name of the protocol being implemented, for example,
"etsiBssmapLe3...") which eats up characters. Those rules stem from the
limitations of the language, which is a proprietary extension of C.
Also, I use the names provided by the specs without any attempts at
abbreviations because short, abbreviated names are a false economy since
whatever time is saved in typing will be be paid back tenfold later on
when doing maintenance. Being completely unambiguous and avoiding any
possible confusions makes future modifications _so_ much easier than
trying to figure out some of the damnably cryptic abbreviations other
programmers have used at work -- it's not easier reading if you have to
read _5_ different source files to figure out which _1_ corresponds to a
given parameter in a spec!

I must say that _most_ names I use are <= 31 characters, though.

Larry



Tue, 11 Nov 2003 10:55:46 GMT  
 Long names are doom ?

...

Quote:
> - "it degrades the legibility of a program to use identifiers that
>   can't be easily remembered...."

...

That is the most important single point, and the reason why long
identifiers are a good thing to have available.

Abbreviations in identifiers make them less memorable. For a given
concept, there is the full name and possibly several ways of
abbreviating it, and anyone using it has to remember which to use. I try
to avoid them in public names, including class names.

Also, a consistent naming system makes names more memorable.

Sometimes, very rarely, a consistent naming scheme can lead to a
situation in which limiting the name to e.g. 31 characters would require
it to either break its naming convention or have some components
abbreviated.

For example, take a look at the constant names in
javax.accessibility.AccessibleContext. Names such as
"ACCESSIBLE_TABLE_COLUMN_DESCRIPTION_CHANGED" could be made shorter by
either abbreviating or not using a consistent scheme, but doing so would
make them harder to remember. In Fortran I suppose it would be called
something like ACCTABCOLDESCCHNGE.

Patricia



Tue, 11 Nov 2003 11:21:04 GMT  
 Long names are doom ?

quoted :

Quote:
>> - "it degrades the legibility of a program to use identifiers that
>>   can't be easily remembered...."
>...

>That is the most important single point, and the reason why long
>identifiers are a good thing to have available.

 The other place long names can be useful is in mechanically generated
code.

-
For more detail, please look up the key words mentioned in this post in
the Java Glossary at:
http://mindprod.com/gloss.html or http://209.153.246.39/gloss.html
If you don't see what you were looking for, complain!
or send your contribution for the glossary.
--
Roedy Green, Canadian Mind Products
Custom computer programming since 1963.
Almost ready to take on new work.



Tue, 11 Nov 2003 11:24:47 GMT  
 Long names are doom ?

Quote:


> >   Anybody use variables/names longer than 31 character
> > and finds it really useful ?

>  Yes, I do occasionally use very long identifiers.  Normally, I do so when I
>  am using a lot of identifiers according to a set naming convention.  For
>  example, I might, in a Swing GUI application, declare an Action subclass
>  called:

>      viewPreferencesGeneralOptionsAction

>  That's 35 characters.  If that's really my menu structure (that is, view |
>  prefs | general | options) then I really want to use that variable name.

viewPrefsGenOptAction - that's 21, and just as readable.

-Jan

--
Jan Schaumann
http://www.netmeister.org



Tue, 11 Nov 2003 11:37:51 GMT  
 Long names are doom ?

Quote:


>>  Yes, I do occasionally use very long identifiers.  Normally, I do so when I
>>  am using a lot of identifiers according to a set naming convention.  
>>  For example, I might, in a Swing GUI application, declare an Action subclass
>>  called:

>>      viewPreferencesGeneralOptionsAction

>>  That's 35 characters.  If that's really my menu structure (that is, view |
>>  prefs | general | options) then I really want to use that variable name.

>viewPrefsGenOptAction - that's 21, and just as readable.

viewPrefsGenOptAction?  Do you mean soething like a procedure
to VIEW PREFerences implemented as a GENeric unit and the procedure
has an OPTional ACTION.

The m{*filter*}of the story, all names are "readable" to the author.
The real test is what other people might think.  Abbreviations are
good, but only if they aren't ambiguous.

--
=======================================================================
 Life is short.                  | Craig Spannring

 --------------------------------+------------------------------------



Tue, 11 Nov 2003 13:18:02 GMT  
 Long names are doom ?

Quote:
>   Anybody use variables/names longer than 31 character
> and finds it really useful ?
> Then please respond  why, where, when.

  When I'm in too big a hurry to do it right?
Coming up with good names is neither quick nor easy.  Sometimes it's
better to be verbose and clean it up later, than to be cryptic and
try to clean it up later.


Tue, 11 Nov 2003 13:46:48 GMT  
 Long names are doom ?

Quote:

> Hi All,

>  Anybody use variables/names longer than 31 character
>and finds it really useful ?

>Then please respond  why, where, when.
>I have folks here in comp.lang.fortran who will die claiming that they

>- "never seen a well written, legible program
>  that uses any identifiers longer than 18-20 characters..".
>- "long variables names are *hard* to read.  And, you have to
>  read though all the characters of every instance of them...".
>- "it degrades the legibility of a program to use identifiers that
>  can't be easily remembered...."

>As a result, despite 90% of computer languages have long, very
>long or 'infinite' identifiers, fortran folks seems plan to stay
>with their 6...aargh ...sorry this was just not far ago... 31 character
>limit intil year 3000.

While 31 is arbitrary and obviously ``wrong'' for not being 0, 1 or
infinity, I must agree that identifiers longer that most Russian novels
are worst. [Especially to those of us who have worked with people who
indent 2 spaces at a time, use a 132 column editor and consider the
whitespace as a goal to fill.] That is there must be some number n
where the pain of seeing identifiers of length > n is worst than the
pain of having to make all identifers have length <= n. It is more
likely that the answer is 42, but it could be 31.

--
http://www.math.fsu.edu/~bellenot
bellenot <At/> math.fsu.edu
+1.850.644.7189 (4053fax)



Tue, 11 Nov 2003 13:42:26 GMT  
 Long names are doom ?

Quote:


> ...
> > - "it degrades the legibility of a program to use identifiers that
> >   can't be easily remembered...."
> ...

> That is the most important single point, and the reason why long
> identifiers are a good thing to have available.

> Abbreviations in identifiers make them less memorable. For a given
> concept, there is the full name and possibly several ways of
> abbreviating it, and anyone using it has to remember which to use. I try
> to avoid them in public names, including class names.

Would you be "less memorable" if you were


instead of simply


Easily ninety percent of all Web users have no idea what any of
the abbreviations http, www, com, org, etc. stand for. But does
that make it harder for them to remember the URL www.mtv.com?
Imagine a typical URL spelled out in its entirety. It would be
absurdly long and unwieldy!

We use abbreviations for various reasons, not the least of which
is as a mnemonic aid. This is certainly true of identifiers in
computer programming languages.

Quote:
> Also, a consistent naming system makes names more memorable.

I don't think anyone would disagree with that. But given two
consistent naming systems (or two inconsistent naming (non-)systems),
which one is to be preferred: the one that allows long names or
the one that does not?

There's no One Answer for every language, culture, compiler, company,
and circumstance. This topic is mostly fodder for religious wars.

Quote:
> Sometimes, very rarely, a consistent naming scheme can lead to a
> situation in which limiting the name to e.g. 31 characters would require
> it to either break its naming convention or have some components
> abbreviated.

So abbreviate consistently. And don't forget to use acronyms, too
("EOF", "NaN", etc.).

Quote:
> For example, take a look at the constant names in
> javax.accessibility.AccessibleContext. Names such as
> "ACCESSIBLE_TABLE_COLUMN_DESCRIPTION_CHANGED" could be made shorter by
> either abbreviating or not using a consistent scheme, but doing so would
> make them harder to remember. In Fortran I suppose it would be called
> something like ACCTABCOLDESCCHNGE.

Or ACCESS_TBL_COL_DESC_CHGD (24 characters). This is no more
difficult to remember than your 43-character, spelled-out version.
Indeed, I have seen each of these same four abbreviations used many
times before. They're pretty standard.

--
Jim Monty

Tempe, Arizona USA



Tue, 11 Nov 2003 14:19:13 GMT  
 Long names are doom ?

Quote:




> >>  Yes, I do occasionally use very long identifiers.  Normally, I do so when I
> >>  am using a lot of identifiers according to a set naming convention.
> >>  For example, I might, in a Swing GUI application, declare an Action subclass
> >>  called:

> >>      viewPreferencesGeneralOptionsAction

> >>  That's 35 characters.  If that's really my menu structure (that is, view |
> >>  prefs | general | options) then I really want to use that variable name.

> >viewPrefsGenOptAction - that's 21, and just as readable.

> viewPrefsGenOptAction?  Do you mean soething like a procedure
> to VIEW PREFerences implemented as a GENeric unit and the procedure
> has an OPTional ACTION.

Perhaps it will VIEW the PREFerenceS and GENerate the OPTimal ACTION?

Why did "Preferences" get to keep the final "s", being abbreviated to
"Prefs", but "Options" went to "Opt"? Faced with that identifier, in its
original meaning, I would keep putting the "s" on both, or dropping it
from both, or getting it the wrong way round.

- Show quoted text -

Quote:

> The m{*filter*}of the story, all names are "readable" to the author.
> The real test is what other people might think.  Abbreviations are
> good, but only if they aren't ambiguous.

> --
> =======================================================================
>  Life is short.                  | Craig Spannring

>  --------------------------------+------------------------------------



Tue, 11 Nov 2003 14:12:08 GMT  
 Long names are doom ?



Quote:

>   Anybody use variables/names longer than 31 character
> and finds it really useful ?

> Then please respond  why, where, when.

(1) Source code generators can easily generate new names when
     they do not have to consider name length.

    [All kinds of limits can be reached more easily by automatic
     generator tools. This used to be very common. Newer compilers
     have taken this into consideration based on experience.]

(2) Editors with completion make long names tolerable. Languages
     without name space mechanisms make long names necessary.
    Readable code includes names longer than 31 character sometimes
    when programmers combine longer, unabbreviated names. But
    hopefully not often.

--
Patrick Logan



Tue, 11 Nov 2003 14:12:51 GMT  
 Long names are doom ?

Quote:

> Easily ninety percent of all Web users have no idea what any of
> the abbreviations http, www, com, org, etc. stand for. But does
> that make it harder for them to remember the URL www.mtv.com?
> Imagine a typical URL spelled out in its entirety. It would be
> absurdly long and unwieldy!

> We use abbreviations for various reasons, not the least of which
> is as a mnemonic aid. This is certainly true of identifiers in
> computer programming languages.

Yes, we use abbreviations and acronyms for *common* things - but given a
general long variable name, in many cases there won't be a "standard"
abbreviation, so the author has to check each time or until they
remember - and each poor maintenance programmer has to learn the same
set of abbreviations!

Abbreviations are fine when they're unambiguous and easily remembered,
but not when there could be a dozen ways of abbreviating a long name.

--

http://www.pobox.com/~skeet
If replying to the group, please don't mail me at the same time



Tue, 11 Nov 2003 15:32:33 GMT  
 Long names are doom ?

Quote:

>   Anybody use variables/names longer than 31 character
> and finds it really useful ?

Constants for Unicode characters?

GREEK_CAPITAL_LETTER_ALPHA_WITH_DASIA_AND_PERISPOMENI_AND_PROSGEGRAMMENI
ARABIC_LIGATURE_UIGHUR_KIRGHIZ_YEH_WITH_HAMZA_ABOVE_WITH_ALEF_MAKSURA_ISOLATED_FORM

SCNR.



Tue, 11 Nov 2003 19:25:17 GMT  
 Long names are doom ?

Quote:



> the number n ... is more
> likely that the answer is 42, but it could be 31.

As in the answer to life.

6 x 9
     (13)



Tue, 11 Nov 2003 19:39:41 GMT  
 
 [ 641 post ]  Go to page: [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43]

 Relevant Pages 

1. Long names are doom ?

2. Long names are doom ?

3. Fw: Long names are doom ?

4. Long names are doom ?

5. Long names are doom ?

6. Long names are doom ?

7. Long names are doom ?

8. Long names are doom ?

9. Long names are doom ?

10. Long names are doom ?

11. Long names are doom ?

12. Long names are doom ?

 

 
Powered by phpBB® Forum Software