ISO Studies of underscores vs MixedCase in Ada or C++

W

Wes Groleau

So Bandshift should be abbreviated Band ?

Megahertz should be Mega, not MHz ?

Message should be Mess, not Msg ?
I prefer the suggestion from the Ada style guide (IIRC) that you don't
abbreviate words, and that you only use acronyms from a limited
project-specific list.

And that list should be designed to include only
a limited number of items, using the abbreviation
that is already widely used in the problem domain.

(If no widely-used abbreviation exists, the item
should not be abbreviated.)

And the following practice is sad, but it does happen
in some places:

Problem: "Abbreviation is not on the approved list."
Solution: "Change the list; we're building TODAY."
 
S

Stephen Baynes.

Jacob Sparre Andersen said:
Jakob Bieling wrote:

[ abbreviated identifier prefixes ]
Not sure where I picked that habit up, but I guess it is pure laziness.
I could not imagine having to type those long names everytime you use
them.

Well. I tend to read code more often than I write it (even my own), and
most of my time is spent thinking about what to write, so saving a few
keystrokes really doesn't make sense to me.
Especially counter variables in for-loops (posting from comp.lang.c++) ...
you also use simple i's and j's etc. there, right?

No. (unless it is for matrix and tensor manipulation, where the
"documentation" actually says "i", "j" and "k")

To me the length of the name should reflect the size of the scope. A one
letter variable name is fine for the counter in a very short for loop, or a
temporary that is only used for a couple of adjacent statements. But if the
variable is used over many lines a longer more meaningful name is required.
Global variables tend to end up with the longest names as they have to be
used and understood in many more contexts.

Like all rules - there are exceptions. In particular if something is used
very frequently then a shorter name is desirable for convenience and
acceptable as it will be well known and understood. [eg 'stderr']
 
G

Gene Wirchenko

On Fri, 03 Oct 2003 15:42:20 -0700, Peter Ammon

[snip]
Agreed! I wish that more languages allowed hyphen use in identifiers.
Dylan is the only one I can think of off the top of my head.

COBOL does.

Sincerely,

Gene Wirchenko
 
O

Oplec

Gene said:
On Fri, 03 Oct 2003 15:42:20 -0700, Peter Ammon

[snip]

Agreed! I wish that more languages allowed hyphen use in identifiers.
Dylan is the only one I can think of off the top of my head.


COBOL does.

Sincerely,

Gene Wirchenko

Is there a link to a document on ISO Studies of underscores... ?

Thanks, Oplec.
 
D

Dave Vandervies

On Fri, 03 Oct 2003 15:42:20 -0700, Peter Ammon

[snip]
Agreed! I wish that more languages allowed hyphen use in identifiers.
Dylan is the only one I can think of off the top of my head.

COBOL does.

As does Scheme, along with (if I'm not mistaken) most or all of the
other members of the Lisp family.


dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,145
Messages
2,570,826
Members
47,372
Latest member
LucretiaFo

Latest Threads

Top