comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Case sensitivity (was Re: no title)
Date: 03 Jun 2003 13:21:27 -0400
Date: 2003-06-03T13:21:27-04:00	[thread overview]
Message-ID: <wccznkzjcvc.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 1054651042.211055@master.nyc.kbcfp.com

Hyman Rosen <hyrosen@mail.com> writes:

> Preben Randhol wrote:
> > It is far easier to rather better to use different
>  > words than to simply change the case.
> 
> The point remains that I may want to use the same word
> in different cases to mean different things. The C
> example of upper case as the type and lower case as the
> object is an example. Ada says I can't do that. Why?
> Because having one English word mean two different things
> is confusing? But Ada already allows that. So it's an
> arbitrary decision made by people who don't like case
> sensitivity forcing their view on those who do.

Well, that last sentence is sort of silly.  *Every* rule of every
programming language is a decision made by people forcing their decision
on other people don't like that rule.  Call it an "arbitrary" rule, if
you like.  ;-)

Anyway, what lots of folks seem to be missing is that there are more
choices than "case sensitive" or "case insensitive".  The rule I favor
would be for overload resolution to be case insensitive, but to have an
extra legality rule saying you have to use the right case.  This is
essentially what you get if you use the GNAT switch that somebody
mentioned.  For example:

    procedure FOO(X: Integer);
    procedure Foo(X: Boolean);

    Foo(True);

would use types, and not case, to resolve which foo you're talking about
(the Boolean one).  But if you say:

    FOO(True); -- illegal

it would still resolve to the Boolean foo, but you get an error because
you spelled it with the wrong case.  FOO(123) would be OK.

If we further allow everything to be overloaded (not just subprograms,
and then bogusly pretend that enumeration literals are subprograms),
then your example:

    function Put(string: String);

would be fine.  Presumably, the "String" after ":" would resolve to the
type name in Standard, since that's what is expected after ":".  ("The
type of type is type.")

The case sensitive rule says you can declare "Foo: Integer; FOO: Integer;",
which is clearly confusing.  The case insenstive rule says you can't do
that, but you can declare "Foo: Integer;" and then refer to it as FOO,
which I think damages readability.  The more complicated rule I outlined
above solves *both* problems.

Somebody elsewhere in this thread denigrated this:

    function Put(string: String);

as being too "lazy" to come up with good names.  I don't agree.
We've had endless debates as to whether it should be "A_String: String"
versus "String: String_Type" and all kinds of other variations on
those.  But it seems to me that "string/String" is a perfectly good
name for a type, and for a parameter of that type.  A_String doesn't
help; it doesn't add any information (references make it obvious on
context).  And with this idea, case helps distinguish, but can never
confuse.  A language should not be about punishing programmers who are
too "lazy" to jump through hoops, but should be about aiding the writing
of readable code.

Many folks have advocated using more-descriptive names for the objects.
For example, City_Name instead of A_String.  That's of course a good
idea when there *is* a more descriptive name, but for general-purpose
parameters, it doesn't work.  Put takes *any* string; there is no
adjective such that Adj_String would aid understanding of the program.

Of course, neither the Ada rule nor the C rule is going to change.  (I'm
on the ARG, and I would certainly never vote for a grossly incompatible
language change!)  I just find it interesting to discuss better
alternatives.

- Bob



  parent reply	other threads:[~2003-06-03 17:21 UTC|newest]

Thread overview: 190+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-02  7:55 no title And838N
2003-06-02  8:09 ` Preben Randhol
2003-06-02 10:41   ` Case sensitivity (was Re: no title) Sergey Koshcheyev
2003-06-02 11:03     ` Bobby D. Bryant
2003-06-02 11:12     ` Preben Randhol
2003-06-02 11:56       ` Sergey Koshcheyev
2003-06-02 12:46         ` Bobby D. Bryant
2003-06-02 13:50           ` Sergey Koshcheyev
2003-06-02 14:35             ` Preben Randhol
2003-06-02 14:51               ` Sergey Koshcheyev
2003-06-02 14:52               ` Bill Findlay
2003-06-02 20:36               ` Alexander Kopilovitch
2003-06-02 12:55         ` Preben Randhol
2003-06-02 12:58           ` Preben Randhol
2003-06-02 13:54             ` Sergey Koshcheyev
2003-06-02 14:44               ` Preben Randhol
2003-06-02 15:06                 ` Sergey Koshcheyev
2003-06-02 15:42                   ` Preben Randhol
2003-06-03  1:15                 ` Randy Brukardt
2003-06-03  3:47                   ` John R. Strohm
2003-06-03 11:36                     ` Preben Randhol
2003-06-03 15:05                       ` Robert I. Eachus
2003-06-03 20:12                         ` Randy Brukardt
2003-06-05  1:48                           ` Robert I. Eachus
2003-06-03 16:25                       ` David C. Hoos
2003-06-02 13:24     ` Arthur Evans Jr
2003-06-02 13:38       ` Sergey Koshcheyev
2003-06-02 15:20         ` Robert C. Leif
2003-06-02 15:33           ` Larry Kilgallen
2003-06-03  1:35             ` Randy Brukardt
2003-06-05 17:30           ` Larry Hazel
2003-06-05 17:55           ` Hyman Rosen
2003-06-08  1:52       ` AG
2003-06-08  3:24         ` Hyman Rosen
2003-06-08  4:36           ` AG
2003-06-08  4:39             ` Hyman Rosen
2003-06-02 15:48     ` Martin Dowie
2003-06-02 18:18     ` Mike Silva
2003-06-02 18:29       ` Hyman Rosen
2003-06-02 18:40         ` tmoran
2003-06-02 18:51           ` Bobby D. Bryant
2003-06-02 21:24             ` Mike Silva
2003-06-03  3:50             ` John R. Strohm
2003-06-03  9:29             ` Georg Bauhaus
2003-06-02 19:02           ` Hyman Rosen
2003-06-02 20:28             ` tmoran
2003-06-03  9:33             ` Georg Bauhaus
2003-06-02 19:06           ` Georg Bauhaus
2003-06-03  3:49           ` John R. Strohm
2003-06-03  7:42           ` Jean-Pierre Rosen
2003-06-02 21:21         ` Mike Silva
2003-06-02 21:56           ` Hyman Rosen
2003-06-02 22:56             ` Larry Kilgallen
2003-06-02 23:30             ` Preben Randhol
2003-06-08  2:26             ` AG
2003-06-03  7:41       ` Jean-Pierre Rosen
2003-06-03 14:06         ` Hyman Rosen
2003-06-03 14:31           ` Preben Randhol
2003-06-03 14:49             ` Hyman Rosen
2003-06-03 16:29           ` Jean-Pierre Rosen
2003-06-03 18:06             ` Hyman Rosen
2003-06-03 18:34           ` Mike Silva
2003-06-03 18:53             ` Hyman Rosen
2003-06-04 10:41               ` Preben Randhol
2003-06-04 14:11                 ` Hyman Rosen
2003-06-04 15:48                   ` Preben Randhol
2003-06-04 16:03                     ` Hyman Rosen
2003-06-04 16:24                       ` Preben Randhol
2003-06-04 17:30                         ` Hyman Rosen
2003-06-04 17:36                           ` Preben Randhol
2003-06-04 17:52                             ` Hyman Rosen
2003-06-04 17:05                     ` Larry Kilgallen
2003-06-04 17:45                       ` Hyman Rosen
2003-06-05 17:23                         ` Stephen Leake
2003-06-05 17:51                           ` Hyman Rosen
2003-06-06  1:24                           ` James Rogers
2003-06-06  9:01                             ` Simon Wright
2003-06-06 10:35                               ` Preben Randhol
2003-06-05 17:51                     ` Larry Kilgallen
2003-06-08  5:28                       ` AG
2003-06-04 16:19                   ` Larry Kilgallen
2003-06-04 21:45                     ` Mike Silva
2003-06-08  3:56                   ` AG
2003-06-08  4:14                     ` Hyman Rosen
2003-06-08  4:46                       ` AG
2003-06-08  4:59                         ` Hyman Rosen
2003-06-08  5:11                           ` AG
2003-06-08  5:14                             ` Hyman Rosen
2003-06-08 10:09                       ` Frank J. Lhota
2003-06-09  3:06                         ` Wesley Groleau
2003-06-09  3:48                         ` Hyman Rosen
2003-06-09 21:09                         ` Warren W. Gay VE3WWG
2003-06-10  3:36                           ` Wesley Groleau
2003-06-10 16:02                             ` Warren W. Gay VE3WWG
2003-06-09 16:56                       ` Warren W. Gay VE3WWG
2003-06-09 18:21                         ` Hyman Rosen
2003-06-09 21:06                           ` Warren W. Gay VE3WWG
2003-06-10 10:23                           ` Preben Randhol
2003-06-12 21:58                             ` Michael Bode
2003-06-03  2:44     ` Steve
2003-06-03  3:13       ` Wesley Groleau
2003-06-03  3:41         ` Hyman Rosen
2003-06-03 11:41           ` Preben Randhol
2003-06-03 13:30             ` Hyman Rosen
2003-06-03 13:46               ` Vinzent Hoefler
2003-06-03 14:30                 ` Preben Randhol
2003-06-03 15:16                   ` Vinzent Hoefler
2003-06-03 15:36                     ` Preben Randhol
2003-06-03 14:28               ` Preben Randhol
2003-06-03 14:37                 ` Hyman Rosen
2003-06-03 14:51                   ` Preben Randhol
2003-06-03 15:03                     ` Hyman Rosen
2003-06-03 18:12                       ` Wesley Groleau
2003-06-08  5:46                       ` AG
2003-06-08  6:30                         ` Hyman Rosen
2003-06-08  8:24                           ` AG
2003-06-08  9:43                             ` Hyman Rosen
2003-06-09  3:03                               ` Wesley Groleau
2003-06-03 15:05                   ` John R. Strohm
2003-06-03 15:31                     ` Hyman Rosen
2003-06-04 10:16                       ` Ole-Hjalmar Kristensen
2003-06-03 17:21                   ` Robert A Duff [this message]
2003-06-03 17:40                     ` Preben Randhol
2003-06-03 18:20                     ` Wesley Groleau
2003-06-03 19:16                     ` Sergey Koshcheyev
2003-06-03 19:44                       ` Robert A Duff
2003-06-04  2:05                   ` James Rogers
2003-06-04  2:40                     ` Wesley Groleau
2003-06-04 11:14                       ` Preben Randhol
2003-06-04  6:21                     ` Hyman Rosen
2003-06-04 13:46                       ` Jim Rogers
2003-06-04 14:22                         ` Hyman Rosen
2003-06-04 19:26                           ` Jim Rogers
2003-06-04 20:00                             ` Hyman Rosen
2003-06-04 20:24                               ` David C. Hoos
2003-06-04 20:40                                 ` Hyman Rosen
2003-06-04 22:11                               ` Wesley Groleau
2003-06-04 21:13                             ` Simon Wright
2003-06-05 17:27                               ` Stephen Leake
2003-06-04 13:54                       ` Leif Roar Moldskred
2003-06-08  6:08                       ` AG
2003-06-08  6:25                         ` Hyman Rosen
2003-06-08  8:20                           ` AG
2003-06-08  9:48                             ` Hyman Rosen
2003-06-10  8:23                               ` Leif Roar Moldskred
2003-06-10 14:11                                 ` Hyman Rosen
2003-06-10 14:58                                   ` Leif Roar Moldskred
2003-06-10 16:05                                     ` Hyman Rosen
2003-06-10 16:37                                       ` Preben Randhol
2003-06-10 17:16                                         ` Hyman Rosen
2003-06-10 17:28                                           ` Preben Randhol
2003-06-10 18:14                                             ` Hyman Rosen
     [not found]                     ` <0egDa.45 <1055265377.116836@master.nyc.kbcfp.com>
2003-06-10 18:19                       ` Matthew Woodcraft
2003-06-10 20:36                         ` Hyman Rosen
2003-06-10 23:04                           ` Matthew Woodcraft
2003-06-04 12:07                   ` Larry Kilgallen
2003-06-08  4:22               ` AG
2003-06-08  4:41                 ` Hyman Rosen
2003-06-08  4:58                   ` AG
2003-06-08  5:00                     ` Hyman Rosen
2003-06-03  8:38         ` Vinzent Hoefler
2003-06-03 18:26           ` Wesley Groleau
2003-06-03  9:53       ` Martin Dowie
2003-06-03 11:37       ` Larry Kilgallen
2003-06-08  1:21     ` AG
2003-06-08  3:21       ` Hyman Rosen
2003-06-02 10:56 ` no title Georg Bauhaus
2003-06-02 11:01 ` Bobby D. Bryant
2003-06-02 20:23 ` Gautier Write-only
2003-06-02 21:33 ` Luke A. Guest
  -- strict thread matches above, loose matches on Subject: below --
2003-06-04 16:30 Case sensitivity (was Re: no title) Lionel.DRAGHI
2003-06-04 17:57 ` Hyman Rosen
2003-06-05  9:07 Lionel.DRAGHI
2003-06-05 14:13 ` Hyman Rosen
2003-06-05 15:39   ` Preben Randhol
2003-06-05 15:44   ` Larry Kilgallen
2003-06-05 15:49     ` Preben Randhol
2003-06-05 16:28       ` Sergey Koshcheyev
2003-06-05 17:14         ` Preben Randhol
2003-06-05 16:36     ` Hyman Rosen
2003-06-05 16:53       ` Larry Kilgallen
2003-06-05 17:15         ` Preben Randhol
2003-06-05 17:30 ` Wesley Groleau
2003-06-05  9:21 Lionel.DRAGHI
2003-06-05 14:14 ` Hyman Rosen
2003-06-05 17:34   ` Stephen Leake
2003-06-05 17:31 ` Stephen Leake
2003-06-05 19:31   ` Wesley Groleau
2003-06-10 11:14 Lionel.DRAGHI
2003-06-11 10:48 Lionel.DRAGHI
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox