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

From: Jacob Sparre Andersen (sparre_at_crs4.it)
Date: 10/20/03


Date: Mon, 20 Oct 2003 09:40:53 +0200

James Dow Allen wrote:

> CamelMode, camel_mode, etc. are all quite *readable*;

It may be a matter of personal taste (haven't seen any actual studies),
but I prefer underscores between words, when I am no allowed to put
spaces there. In Ada I follow the style guide and use both underscores
and capitalisation.

> when using long
> names the important thing is to make them *writable*,

Try to count how often you _read_ and _write_ an identifier. I think
you might be surprised by the difference. Easy writing of the
identifers is not anywhere nearly as important as easy reading.

> Consistency is therefore the important thing.

It is.

> If you abbreviate words,
> abbreviate them as the first 4 (or whatever) letters, consistently.

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.

> (I usually rewind a file with "lseek(fd, 0L, 0)" because I can't
> remember if 0 is SEEKSET or SEEK_SET.)

Very annoying with a standard library with an inconsistent naming of
identifiers.

One more point on the topic of consistent naming of identifiers. I find
the style with using different naming conventions for functions,
constants, variables, etc. very annoying. I _don't_ want to have to
worry if something is a function, constant or variable. Specially not
if it actually is an implementation dependent detail. So _please_ use
the same naming convention for all identifiers.

Jacob

-- 
"Any, sufficiently complicated, experiment is indistinguishable from
  magic."


Relevant Pages

  • Re: ISO Studies of underscores vs MixedCase in Ada or C++
    ... In Ada I follow the style guide and use both underscores ... I prefer the suggestion from the Ada style guide that you don't ... One more point on the topic of consistent naming of identifiers. ... the style with using different naming conventions for functions, ...
    (comp.lang.cpp)
  • Re: ISO Studies of underscores vs MixedCase in Ada or C++
    ... In Ada I follow the style guide and use both underscores ... I prefer the suggestion from the Ada style guide that you don't ... One more point on the topic of consistent naming of identifiers. ... the style with using different naming conventions for functions, ...
    (comp.programming)
  • Re: [LONG] Re: Request for comment on my tiny learning project: dfighterdb (mytree)
    ... The initial doublescores are useless. ... MYTREE_H are four distinct identifiers. ... underscores are five useless keystrokes. ... Parts of tokens don't make identifiers at all. ...
    (comp.lang.c)
  • Re: case-sensitivity
    ... I wonder why there is no mainstream file manager or desktop environment, ... simply displays filenames with underscores by replacing underscores with ... There should be no need to try an make identifiers look like normal ... They are not normal words and are used to allow for referencing, ...
    (comp.lang.scheme)
  • Re: The use of underscore characters in field naming conventions
    ... Ctrl+Left and Ctrl+Right don't work with underscores in the VBA editor ... > Arrow or Right Arrow on the keyboard when all of the text is together like ... >> There's really no right answer: naming conventions are just that, ... >> Doug Steele, Microsoft Access MVP ...
    (microsoft.public.access.tablesdbdesign)