From: "Vincent Marciante" <vmarciante@decilog.com>
Subject: Re: Types, packages & objects : the good old naming conventions question (without religious ware)
Date: Fri, 6 Nov 2009 13:58:42 -0500
Date: 2009-11-06T13:58:42-05:00 [thread overview]
Message-ID: <QaWdnfOsAYiw72nXnZ2dnUVZ_hmdnZ2d@earthlink.com> (raw)
In-Reply-To: uskcsne3h.fsf@stephe-leake.org
"Stephen Leake" <stephen_leake@stephe-leake.org> wrote in message
news:uskcsne3h.fsf@stephe-leake.org...
> "Vincent Marciante" <vmarciante@decilog.com> writes:
>
>> "Stephen Leake" <stephen_leake@stephe-leake.org> wrote in message
>> news:u1vkdrert.fsf@stephe-leake.org...
>>> This is illegal:
>>>
>>> procedure (List : in list);
>>>
>>> So we have to add noise to either the object or the type, to keep the
>>> compiler happy. That's all there is to it.
>>
>> That is not necessary:
>>
>> package sdgfkjasf is -- or whayever
>>
>> type List is ...
>>
>> procedure jsdfks (List : sdgfkjasf.List);
>>
>> ...
>
> That's the first time I've seen that suggestion.
Or maybe you forgot!
The following is part of a old discusion to
which you contributed:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Newsgroups: comp.lang.ada
From: "Vincent Marciante" <marciant_rem...@li.net>
Date: Fri, 5 Oct 2001 15:17:35 -0400
Local: Fri, Oct 5 2001 2:17 pm
Subject: Re: on package naming, should the word "_pkg" be part of it?
"Jeffrey Carter" <jeffrey.car...@boeing.com> wrote in message
<snip>
> John McCabe wrote:
> > type Car_Type is
> > record
> > ....
> > end record;
> > procedure DoSomething (Car : in out Car_Type);
> > could be replaced by:
> > type Car is
> > record
> > ....
> > end record;
> > procedure DoSomething (The_Car : in out Car);
> I recall reading articles about the psychology of understanding programs
> (sorry, Robert Dewar, I don't have references for this, either.
> Hopefully it's not just random neurons firing in my brain) that stated
> that the first few characters of an identifier are the most important in
> determining what you're reading. Having identifiers that are identical
> for the first few characters requires more time and effort to
> understand, and results in more errors in understanding.
> Although both _Type and The_ are ways to resolve the type/parameter name
> conflict, The_ is worse because it makes the first four characters of
> every parameter name the same.
> I make the type name reflect what the type contains. For example
> type Car_Info ...
> procedure P (Car : in Car_Info ...
> This is not a popular approach, though, because it requires thought
> about every type name.
> --
> Jeffrey Carter
What about the following:
package XYZ is
type Car ...
procedure P (Car : in XYZ.Car ...
--
Vinny
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> It's very interesting. The package name has to show up every time the type
> is
> paired with an object of the same name. But in other situations, the
> package name can be left off.
>
> So this ends up being less noise than appending _Type everywhere.
>
> Just to be pedantic, it _is_ adding noise. It's just a different form
> of noise than _Type.
>
> I'll have to try it in a semi-real project. I've been using _Type for
> over 15 years, so it will take some effort :).
>
> It's interesting why no one seems to have thought of this before. In
> general, the way to resolve ambiguities in Ada is to use more of the
> full name. Somehow that never occured to me in this context.
>
> --
> -- Stephe
next prev parent reply other threads:[~2009-11-06 18:58 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 [this message]
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
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