case sensitive identifiers (Was: Re: Just Wondering)

David Dyer-Bennet ddb at ns.network.com
Fri Apr 28 07:17:41 AEST 1989


In article <318.nlhp3 at oracle.nl> bengsig at oracle.nl (Bjorn Engsig) writes:
:In article <1314 at ns.network.com> ddb at ns.UUCP (David Dyer-Bennet) writes:
:>
:>How DO people feel about identifiers differing only in casing?  Is this
:>ok?  To be COMPLETELY avoided?  To be avoided except in a very few
:>well-understood conventional cases?
:>
:One of the more common cases where you use identifiers only different in case 
:is for union fields inside structures, e.g.:
:
:#define array wa_union.Array
:#define whole wa_union.Whole

And the other pretty-common case I'm aware of is
    typedef struct FOOBAR {
        int e1, e2, e3;
	struct FOOBAR *next;
    } foobar;
(people often disagree on exactly the casing for each use).  Are there any
other standard idioms for case-distinguished related names?

(Nobody much seems to be addressing what I view as a substantive
question raised in passing in the flamefest, namely when is it "good
programming practice" to use identifiers differing only in casing in
C.  I feel the cases described above are "commonly accepted"
instances, and guess that most people feel that the practice should be
avoided except in particular special cases like these.  Some people
may feel that "accidental" collisions are fine, but would avoid
"systematic" ones.  It seems to me that this question must necessarily
be answered before the question of case sensitivity in the language
can be thoroughly debated, because many people might favor certain
uses, and oppose others.)

(And I've seen a few people suggesting using casing for emphasis in
some cases (with no examples from practice), but no other suggestions
that identifiers should be cased differently at different times.  We DO
seem to mostly agree on a few things...)

-- 
David Dyer-Bennet, ddb at terrabit.fidonet.org, or ddb at ns.network.com
or ddb at Lynx.MN.Org, ...{amdahl,hpda}!bungia!viper!ddb
or ...!{rutgers!dayton | amdahl!ems | uunet!rosevax}!umn-cs!ns!ddb
or Fidonet 1:282/341.0, (612) 721-8967 9600hst/2400/1200/300



More information about the Comp.lang.c mailing list