comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.dash-bauhaus@futureapps.de>
Subject: Re: [OT] interesting reason why a language is considered good
Date: Mon, 16 Apr 2012 23:48:15 +0200
Date: 2012-04-16T23:48:16+02:00	[thread overview]
Message-ID: <4f8c93a0$0$6638$9b4e6d93@newsspool2.arcor-online.net> (raw)
In-Reply-To: <9s7d2eufbh6f$.1ivcyxfztaq42$.dlg@40tude.net>

On 16.04.12 20:00, Dmitry A. Kazakov wrote:

> You asked for examples of programs allegedly suffering from generality of
> the word "when", here is one:

Actually I asked for programs that profit from generality of words
like "when" used as identifiers.

>     case Alignment is
>         when Left =>  ...;
>         when Right =>  ...;
>         when Middle =>  ...;
>     end case;

What's the pain?

>> My question is: If "others" were moved from syntax to identifiers,
>> then what fraction, and what kind of programs will hugely profit
>> because they can now name things "others"?
>
> No, it is you who have to show a great number of reasonable written
> programs hugely suffering if "others" were allowed as an identifier.

I have tried to explain that generic identifiers do not inform about
specific things. "Others" is a generic, unspecific word. Is there
a fraction of programs that profit from generic, unspecific identifiers?
What is it?


> Should not be used /= must be reserved.

Er, yes, did I say that those words should be reserved?
I imagine that one might draw this conclusion if arguing
within a certain set of premises that isn't mine.

> The argument you were trying to make is about illegal words, ones which may
> not to used (because they sound bad for you). Example in Ada:
> "0_Illegal___identifier"

My bad if I did. I think I mentioned a wish for a list of words
not recommended for use as identifiers, in addition to the one
Ada reserves.


>>> Surely "when" and "at" are prefect names for a formal parameter of the type
>>> Time.
>>
>> I disagree. In my initial response, I made them "Leaving_When" and
>> so on, as these names are more meaningful.
>
> Counter example:

Only in case of universally quantified propositions. None of my business.
But anyway,

>     procedure Leave (When : Time);
...
begin
    while Now < When loop
       delay Step;
       Now := Clock;
    end loop;
    Left (Slot (When)) := Now;  -- NB p.p. of to leave
end Leave;

I have tried to choose only unspecific or ambiguous nouns.
Do you find this to be explaining itself well? Note the "well,"
not: possible to understand for the next few moments.

begin
    while Now < Scheduled_Departure loop
       delay Pausing_Time;
       Now := Clock;
    end loop;
    Actual_Departure (Minute_Of (Scheduled_Departure)) := Now;
end Leave;

The first solution lets insiders pride themselves of knowing what
the generic words mean, the second solution less so, I think.
(I claim that neither is perfect.)


>> Simon Wright has recently shown a nice way how to mend the situation
>> with X and Y for surface orientation, using Ada 2012 (substituting
>> Northings and Eastings in the profile, IIRC).
>
> I wonder what Australians would say about that.

You don't mean that Australian drivers (or pilots) do not know how
to head North?



>>>> "What" as an identifier shouldn't be, IMHO,
>>>> reserved or not, so words like "what" not being reserved does
>>>> not count as counter-argument in my book. I'd rather have a
>>>> list of words not recommended to augment reserved words.
>>>
>>> So either they must be reserved or your argument is wrong. The choice is
>>> yours.
>>
>> There is no MUST here.
>
> See. In other words, there are other reasons why "when" is reserved.
> Exactly my point.

Not the point in question, I think.  The point in question is what happens
when even words like "when", i.e. even those that happen to be reserved
now, do loose that special status. (Again, my desire to have a
list of words that should be _effectively_ reserved, maybe trigger
a warning, even when they can be used as identifiers.)


>>> Statistically irrelevant.
>>
>> I know I am not statistically relevant. Yet, for actual statistics,
>> if you see how programs are written in the low budget industry
>> that might change your mind.
>
> You mean that low budget industry has no access to an editor capable to
> colourise Ada source code? Come on, gedit, AdaGide, GPS are free!

A graphical terminal on site? Wow!  I am used to SSH.

But I meant the thoughtless choice of identifiers that just
happens, like sh*t. It is easier to choose generic words
as identifier when a programming language is more permissive,
Simply because it is harder to think of good names than
to speak in broad, generic terms. So Ada unproven "limitation"
is an accidental benefit of "when" etc. being reserved words.

(I will not insist that this phenomenon is a low budget phenomenon,
but I would think that software written in relatively expensive
environments that feature quality control (even when functioning as a
ritual only) do not let inscrutable cleverness pass. At least when
it is understood that software matters.)




  reply	other threads:[~2012-04-16 21:48 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-15 10:27 [OT] interesting reason why a language is considered good Nasser M. Abbasi
2012-04-15 11:57 ` J-P. Rosen
2012-04-16 10:37   ` Peter C. Chapin
2012-04-15 12:27 ` Dmitry A. Kazakov
2012-04-17  6:59   ` tonyg
2012-04-17  7:43     ` Dmitry A. Kazakov
2012-04-15 14:05 ` Bill Findlay
2012-04-15 14:21 ` Pascal Obry
2012-04-15 14:54   ` Simon Wright
2012-04-15 15:34     ` Pascal Obry
2012-04-17  5:42       ` Brad Moore
2012-04-17 16:11         ` Simon Wright
2012-04-17 16:33           ` Robert A Duff
2012-04-17 19:34             ` Simon Wright
2012-04-17 21:42               ` Robert A Duff
2012-04-17 22:24                 ` Randy Brukardt
2012-04-18  7:00                   ` stefan-lucks
2012-04-17 21:17             ` Jeffrey Carter
2012-04-15 23:53     ` Brian Drummond
2012-04-16 10:43 ` Marius Amado-Alves
2012-04-16 11:48   ` Georg Bauhaus
2012-04-16 13:06     ` Dmitry A. Kazakov
2012-04-16 15:01       ` Georg Bauhaus
2012-04-16 15:31         ` Dmitry A. Kazakov
2012-04-16 17:11           ` Georg Bauhaus
2012-04-16 17:19             ` Georg Bauhaus
2012-04-16 18:00             ` Dmitry A. Kazakov
2012-04-16 21:48               ` Georg Bauhaus [this message]
2012-04-17  3:43                 ` Randy Brukardt
2012-04-17  4:43                   ` Bill Findlay
2012-04-17  7:46                   ` Georg Bauhaus
2012-04-17 22:32                     ` Randy Brukardt
2012-04-18  7:10                       ` stefan-lucks
2012-04-18 23:48                         ` Randy Brukardt
2012-04-19 14:22                           ` Shark8
2012-04-17 15:48                   ` Simon Wright
2012-04-17 16:15                     ` Dmitry A. Kazakov
2012-04-17 19:33                       ` Simon Wright
2012-04-17  7:34                 ` Dmitry A. Kazakov
2012-04-17 16:01                   ` Simon Wright
2012-04-17 17:42                   ` Georg Bauhaus
2012-04-17 19:17                     ` Dmitry A. Kazakov
2012-04-17  3:24           ` Randy Brukardt
2012-04-17  3:33           ` Randy Brukardt
2012-04-16 19:55   ` sbelmont700
2012-04-17  0:48   ` Peter C. Chapin
2012-04-17 21:59 ` anon
2012-05-13  4:14   ` David Thompson
replies disabled

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