comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: Latest suggestion for 202x
Date: Mon, 24 Jun 2019 10:16:52 +0300
Date: 2019-06-24T10:16:52+03:00	[thread overview]
Message-ID: <gnbbn2Fn6lbU1@mid.individual.net> (raw)
In-Reply-To: <87imsv4k3z.fsf@nightsong.com>

On 19-06-24 08:40 , Paul Rubin wrote:
> "J-P. Rosen" <rosen@adalog.fr> writes:
>> Case sensitivity brings nothing but confusion.  The principle for any
>> decent language is that if two identifiers mean the same thing in the
>> brain of the reader, then they must correspond to the same entity. And
>> the meaning of a word is not changed by casing.

Yes... most of the time. I recall, as a young programmer several decades 
ago, being stumped for an embarrassingly long time by a compilation 
error from the Burroughs Algol compiler, which would not accept the code

    real IF;
    ...
    if IF > limit then ...

In a case-insensitive language, of course "IF" is just another form of 
the reserved word "if". But my brain insisted that "IF" is an identifier 
that is an acronym / abbreviation for "Intermediate_Frequency"... even 
when "if" and "IF" were adjacent as above!

(That was in the main-frame punch-card ages, when one did not want to 
use long identifiers because of (a) the 80-column (or 72-column) limit, 
and (b) the high risk of spelling the identifier incorrectly and having 
to punch a new card, after waiting an hour or so for the compiler's 
snide error messages.)

> I don't find this in Haskell.  The names of types and of data
> constructors begin with upper-case letters, and the names of ordinary
> variables begin with lower-case letters.  So you could have
>
>    string = "hello"
>
> and that is separate from the type String.  That might not be great
> style but the language lets you tell the two apart.

Formally true, and usually harmless in today's programming styles where 
identifiers are usually longish words.

Ada's case-insensitivity (which I do prefer, in spite of my anecdote 
above) was, I believe, meant to prevent errors such as having two 
variables called respectively "x" and "X" and confusing between them.

Even if "X" is a type identifier and "x" a variable name, there could be 
confusion between, say, x'Size and X'Size, which look very similar but 
can have different values.

That said, I do find it a little irksome that Ada's rules force one to 
invent different, case-insensitive names for types on the one hand, and 
variables on the other. This leads to conventions such as adding "_T" to 
all type names, which seem ugly and cumbersome at first. But I don't 
have any suggestions for a better solution.

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
       .      @       .

  reply	other threads:[~2019-06-24  7:16 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-15 23:59 Latest suggestion for 202x Micah Waddoups
2019-06-16  5:14 ` Jerry
2019-06-16  7:17 ` Dmitry A. Kazakov
2019-06-16 10:22 ` Egil H H
2019-06-16 16:54   ` Maciej Sobczak
2019-06-16 20:09     ` Dmitry A. Kazakov
2019-06-17  6:54     ` Egil H H
2019-06-17  7:42       ` J-P. Rosen
2019-06-17 12:01     ` Mart van de Wege
2019-06-17 13:35       ` Maciej Sobczak
2019-06-17 15:20         ` Dmitry A. Kazakov
2019-06-17 15:32           ` Paul Rubin
2019-06-17 16:43             ` Dmitry A. Kazakov
2019-06-17 21:38           ` Keith Thompson
2019-06-18 15:48             ` Jeffrey R. Carter
2019-06-20 22:21             ` Randy Brukardt
2019-06-21  9:42               ` Dmitry A. Kazakov
2019-06-21 18:12                 ` Keith Thompson
2019-06-21 18:43                   ` Dmitry A. Kazakov
2019-06-21 20:24                     ` Keith Thompson
2019-06-22  6:54                       ` Dmitry A. Kazakov
2019-06-22  8:43                         ` Randy Brukardt
2019-06-22  9:00                           ` Dmitry A. Kazakov
2019-06-22 17:44                         ` Keith Thompson
2019-06-22 18:34                           ` Bill Findlay
2019-06-22 18:37                           ` Dmitry A. Kazakov
2019-06-23  7:38                             ` G.B.
2019-06-23  8:29                               ` Dmitry A. Kazakov
2019-06-23 18:34                               ` Optikos
2019-06-23 19:20                                 ` Dennis Lee Bieber
2019-06-22 20:48                           ` Optikos
2019-06-22 20:53                             ` Optikos
2019-06-23 17:42                             ` Dennis Lee Bieber
2019-06-24  5:07                               ` J-P. Rosen
2019-06-24  5:40                                 ` Paul Rubin
2019-06-24  7:16                                   ` Niklas Holsti [this message]
2019-06-26 18:00                                     ` Stephen Leake
2019-06-24 13:07                                   ` J-P. Rosen
2019-06-24 11:12                                 ` Stefan.Lucks
2019-06-24 12:06                                   ` Niklas Holsti
2019-06-24 20:22                                     ` Randy Brukardt
2019-06-24 20:32                                       ` Keith Thompson
2019-06-24 20:47                                       ` Jeffrey R. Carter
2019-06-24 13:10                                   ` J-P. Rosen
2019-06-22  8:36                   ` Randy Brukardt
2019-06-22 17:39                     ` Keith Thompson
2019-06-16 19:34 ` Optikos
2019-06-16 20:10   ` John Perry
2019-06-16 20:57     ` Optikos
2019-06-16 21:36       ` Dmitry A. Kazakov
2019-06-17 16:48     ` G. B.
2019-06-17 17:12     ` Paul Rubin
2019-06-16 21:41 ` Lucretia
2019-06-19  2:36 ` Micah Waddoups
2019-06-19 11:14   ` Lucretia
2019-06-19 11:45     ` briot.emmanuel
2019-06-19 14:34       ` Optikos
2019-06-19 19:29         ` Lucretia
2019-06-19 16:12   ` G. B.
2019-06-23 20:17 ` Per Sandberg
replies disabled

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