[comp.lang.c] Get off my case

frank@zen.co.uk (Frank Wales) (04/28/89)

To me, all this discussion about whether C should be case-sensitive
is resolvable by asking the question: "what does one gain and lose by
having it?"

As far as I can see, having case-sensitivity provides the benefit that
I can decide how I would like my identifier names to appear.  So I can
have

  ListType *ListEntryPtr;

or

  void SYSTEM_PANIC(char *panic_message);

or whatever I choose.  I can also have identifiers differing only in case,
as in

  typedef struct list
  {
    struct list *Prev, *Next;
    void *SomeData;
  } LIST;

which can be of benefit.  I have the choice.  I like that.

What I lose is the ability to exploit this feature while being a
sloppy typist, which is fine by me.

A possible compromise (if one were needed) would be to allow case-
sensitive declarations, but retain case-insensitive references unless
an ambiguity arose.

So you could have

  char MyArray[80];

and refer to it by

  (void)strcpy(MyArray,"Fred");

  /* my shift keys just broke */
  (void)strcat(myarray,"bert");

  /* MY TERMINAL JUST TURNED INTO A TELETYPE */
  (VOID)STRCAT(MYARRAY,"DAVE");

but if you had

  const double con_g = 9.81183;
  const double con_G = 6.673;

then

  f=con_g+con_G;	/* allowed */
  g=con_g+Con_G;	/* splat! Con_G not declared */

But this seems to be complexification for the sake of appeasing the
Case-Insensitivites, especially since it could mean that the meaning
of legal code could be changed simply by adding a declaration.  It could
make the Obfuscated C Contest entries even weirder.

One of the [many] reasons I prefer C to {Pascal, BASIC, blahblahblah}
is that it trusts me to know what I'm doing, and what I'm typing.  It
doesn't silently "correct" things for me, because I'm a grown-up now,
and while I still need advice from time to time, I don't need hand-holding,
and I see case-insensitive languages as being just that.

Put another way: if case doesn't matter, why should underscores?
Why should white space?  Anyone for FORTRAN?  :-)
--
Frank Wales, Systems Manager,        [frank@zen.co.uk<->mcvax!zen.co.uk!frank]
Zengrange Ltd., Greenfield Rd., Leeds, ENGLAND, LS9 8DB. (+44) 532 489048 x217