comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm-host.bauhaus@maps.futureapps.de>
Subject: Re: Types, packages & objects : the good old naming conventions question (without religious ware)
Date: Sat, 07 Nov 2009 15:28:43 +0100
Date: 2009-11-07T15:28:47+01:00	[thread overview]
Message-ID: <4af5841f$0$6583$9b4e6d93@newsspool3.arcor-online.net> (raw)
In-Reply-To: <ueioaopdk.fsf@stephe-leake.org>

On 11/7/09 6:49 AM, Stephen Leake wrote:

> One reason to use "_Type" is precisely _because_ it means "Ada type";
> there's no need to   wonder about what it means.

But the language meaning of "type" does not help with
the mentioned Message_Type_Type?
If I stubbornly follow your conventions as I understand them,
I'd have to write

   procedure Something (Message_Type : in Message_Type_Type);
or
   procedure Something (Message_Type : in Message_Types.Message_Type);

wouldn't I?  (I speculate that one could add a remark about
first class type objects here, as per Dmitry's suggestion.
More confusion.)


>>>>>> Cf. valid Eiffel:
>>>>>>
>>>>>>      local
>>>>>>         string: STRING
>>>>>>      do
>>>>>>         ...  -- more uses of string and STRING. Or StrINg.
>>> Ah; Eiffel has separate type and object name
>>> spaces. So I don't understand the original example; what was the
>>> point?
>>
>> In a dozen or so lines of subprogram text, the sequence of
>> characters "String" can refer to two different concepts, in Eiffel,
>> when you have declared string : STRING, an object and a type.
>
> So the case is not important; why did you introduce it?

The "String : String" part of the declaration means
  -object-named-String- : -type-named-String-
in Eiffel.  The very same word names both the
object and the type.  Characters case is important to the
reader, however (you have mentioned GNAT's warnings).
The writer may like to use case distinction to "disambiguate"
the same sequence of letters.  That's fine as long as you
live in a single universe of formal names, like when you are
working on the same set of Ada programs for months, and
never need to look elsewhere.


> In another post, someone said Eiffel required<>  around types; is that
> not true?

I mentioned Dylan where you would write string : <string>;
In Eiffel, and in hypothetical 2-namespace-Ada you write STring: STring,
if you want to. The visual difference is none.  Is the difference in
meaning perfectly clear in the body lines following the declaration?


> The point, as always in this discussion, is to save time making up
> separate names for types and objects.
>
>>> Yes, this is an example of name overloading. Overloading, like any
>>> good thing, can be abused.
>>
>> Assuming separate namespaces for objects and types,
>> I can imagine programmers who find "string : STRING"
>> very clever.  Or just a good match for some twisted programming
>> trick.  Why make cleverness, or the appearance thereof,
>> easy to achieve?
>
> Good programmers will just find it natural; why introduce twisted
> programmers into this?

OK, I thought that the design of a general purpose programming
language, together with the naming conventions surrounding it,
should be manageable by a general public of programmers, not just
"programmers who find this natural" =:def "good programmers".
Some good programmers, in fact language makers,
have made String : String impossible.  Supposedly, then, they
did not deem String : String a natural thing, even though they
were good programmers.

Here is an analogous example.
The argument (be a better programmer if you want to use our
language properly) is popular.  Whenever I had the courage to
mention that there are sharp corners in C and that,
therefore, we should be expecting these corners
to cause trouble, I heard it: programmers causing trouble
in C programs lack education! Well...
Proof of trouble is the weekly CVE report about C programs
and the type "int".  That's am empirical fact.  QED.

Is it an empirical fact that most programmers lack education?
Or does C have some dangerous imperfections?
The typical response is a exaggeration of your question: Why count
stupid non-C-knowing less than excellent programmers
in the select set of programmers-finding-C-natural who
know by heart the C standard and the compiler documentation?
("Because we live on planet earth!" is what I think, then.
"A language, or a naming convention, should respect this fact.")

Before turning back to Ada and naming conventions, let me
stress the analogy, regarding Ada programmer skills.
What about C programmers who are writing programs even
though they don't know every detail about C's "int"?
They are writing programs controlling machines that
affect our daily lives.  Should they not?  Should we
shape a language and conventions around the idea that "int"
is fine in the hands of brilliant programmers and that
other programmers should seek different occupations?
In any case, the above speakers will not accept the group of normal
programmers as a premise; mostly because doing so will show
C's imperfections when in the hands of imperfect programmers,
*to* *a* *degree* that is largely caused by C---it could be
less (which is why Cyclone is different, I should think).
Those speaking in favor of C's "idiosyncrasies" like "int" deny
the normal situation of imperfect programming...
This is why I am skeptical of naming conventions that need
twisted knowledge, like List : in out List.

My claim is that if Ada allows List : in out List, then there
will be a growing number of programmers who "save time making
up separate names" and routinely use T : T.
To support this claim, I think I can point at another time saver:
Anonymous "access" was introduced with Ada 2005.  People
like it.  One reason is that it saves time making up
pointer type names.
(Viz. why, instead of declaring pointer types, not just add Foo*
and &Bar like we are used to?  Of course,  I meant "X : access Foo;"
and "Bar'Unchecked_Access"?  Easy.  Saves time.)

IMO, the effect of naming conventions is first and foremost an
effect on human Ada programmers, caused by human programmers.
The language definition will influence naming conventions,
but this is accidental.



  reply	other threads:[~2009-11-07 14:28 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-29 17:11 Types, packages & objects : the good old naming conventions question (without religious ware) Hibou57 (Yannick Duchêne)
2009-10-29 17:47 ` Dmitry A. Kazakov
2009-10-29 18:11 ` Georg Bauhaus
2009-10-29 22:41   ` tmoran
2009-10-30  0:01   ` Robert A Duff
2009-10-30  4:17     ` Georg Bauhaus
2009-10-30  4:52   ` Hibou57 (Yannick Duchêne)
2009-10-30  5:08     ` Jeffrey R. Carter
2009-10-30  5:28       ` Hibou57 (Yannick Duchêne)
2009-10-31 12:13       ` Stephen Leake
2009-10-30  8:14     ` tmoran
2009-10-31  6:35       ` Jacob Sparre Andersen
2009-11-01  8:24         ` Stephen Leake
2009-11-01 10:18           ` Peter C. Chapin
2009-11-01 13:01             ` Hibou57 (Yannick Duchêne)
2009-11-01 13:40               ` Hibou57 (Yannick Duchêne)
2009-11-05  0:33             ` Stephen Leake
2009-11-05  8:37               ` Dmitry A. Kazakov
2009-11-05  8:48                 ` Niklas Holsti
2009-11-05  9:13                   ` Dmitry A. Kazakov
2009-11-06  9:54                   ` Stephen Leake
2009-11-06 10:23                     ` Niklas Holsti
2009-11-06 10:24                     ` Dmitry A. Kazakov
2009-11-05 20:18               ` Vincent Marciante
2009-11-06 10:26                 ` Stephen Leake
2009-11-06 11:34                   ` Hibou57 (Yannick Duchêne)
2009-11-06 12:38                   ` Georg Bauhaus
2009-11-07  5:54                     ` Stephen Leake
2009-11-06 18:58                   ` Vincent Marciante
2009-11-07  5:57                     ` Stephen Leake
2009-11-09 18:25                       ` Vincent Marciante
2009-11-10  7:51                         ` Stephen Leake
2009-11-10 16:53                           ` Vincent Marciante
2009-12-29 23:27                             ` Hibou57 (Yannick Duchêne)
2009-12-30  9:31                               ` Georg Bauhaus
2009-12-30 14:13                                 ` Hibou57 (Yannick Duchêne)
2009-12-31 13:48                                 ` Marco
2010-01-09 15:03                                   ` Hibou57 (Yannick Duchêne)
2010-01-07 15:20                                 ` Hibou57 (Yannick Duchêne)
2010-01-07 15:42                                   ` Hibou57 (Yannick Duchêne)
2009-11-02  0:30           ` tmoran
2009-10-31 12:18       ` Stephen Leake
2009-10-30 10:52   ` Stephen Leake
2009-10-30 12:11     ` Hibou57 (Yannick Duchêne)
2009-10-30 13:40     ` Georg Bauhaus
2009-10-31 11:58       ` Stephen Leake
2009-11-02 20:36         ` Georg Bauhaus
2009-11-02 21:47         ` Randy Brukardt
2009-10-30 18:57     ` Jeffrey R. Carter
2009-10-31  1:45       ` Hibou57 (Yannick Duchêne)
2009-10-31  5:30         ` Hibou57 (Yannick Duchêne)
2009-10-31  5:44           ` Hibou57 (Yannick Duchêne)
2009-10-31  9:49           ` Dmitry A. Kazakov
2009-10-31 11:30             ` Hibou57 (Yannick Duchêne)
2009-10-31 11:47               ` Dmitry A. Kazakov
2009-10-31 12:38                 ` Hibou57 (Yannick Duchêne)
2009-10-31 13:36                   ` Dmitry A. Kazakov
2009-11-01  8:15           ` Stephen Leake
2009-10-31 12:11       ` Stephen Leake
2009-11-02 19:54         ` Georg Bauhaus
2009-11-05  0:39           ` Stephen Leake
2009-11-05 11:44             ` Georg Bauhaus
2009-11-06 10:14               ` Stephen Leake
2009-11-06 14:14                 ` Georg Bauhaus
2009-11-07  5:49                   ` Stephen Leake
2009-11-07 14:28                     ` Georg Bauhaus [this message]
2009-11-07 14:33                       ` Georg Bauhaus
2009-11-08  9:48                       ` Stephen Leake
2009-11-09 19:09                         ` Vincent Marciante
2009-11-10  7:58                           ` Stephen Leake
2009-10-29 18:33 ` Niklas Holsti
2009-10-29 19:35 ` Jeffrey R. Carter
2009-10-30  7:29   ` Niklas Holsti
2009-10-30 18:36     ` Jeffrey R. Carter
2009-10-30  9:24 ` dhenry
2009-10-30 10:01   ` Hibou57 (Yannick Duchêne)
2009-10-30 18:40   ` Jeffrey R. Carter
2009-10-31 12:25     ` Stephen Leake
2009-10-31 12:21   ` Stephen Leake
2009-10-31 13:08     ` Hibou57 (Yannick Duchêne)
2009-11-01  8:21       ` Stephen Leake
2009-10-30 10:48 ` Stephen Leake
2009-10-31  6:27   ` Splitting the object and type name spaces? (Was: Types, packages & objects : the good old naming conventions question (without religious ware)) Jacob Sparre Andersen
2009-10-31  7:16     ` Hibou57 (Yannick Duchêne)
2009-10-31  7:21       ` Hibou57 (Yannick Duchêne)
2009-10-31  9:58     ` Dmitry A. Kazakov
2009-11-02 22:05   ` Types, packages & objects : the good old naming conventions question (without religious ware) Randy Brukardt
2009-11-04 15:44     ` Hibou57 (Yannick Duchêne)
  -- strict thread matches above, loose matches on Subject: below --
2009-10-29 17:48 Britt Snodgrass
2009-10-30 10:56 ` Stephen Leake
2009-10-31 12:26   ` Stephen Leake
replies disabled

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