comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Type naming conventions: Any_Foo
Date: Thu, 5 Dec 2019 17:12:57 -0600
Date: 2019-12-05T17:12:57-06:00	[thread overview]
Message-ID: <qsc2tq$shs$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: qsbu56$18iv$1@gioia.aioe.org

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message 
news:qsbu56$18iv$1@gioia.aioe.org...
> On 2019-12-05 21:03, Jeffrey R. Carter wrote:
...
> There are lots of cases in Ada, you certainly should know that. As a 
> practical example GtkAda declares all widget types twice:
>
>    type Gtk_Button_Record is ...
>    type Gtk_Button is access all Gtk_Button_Record'Class;
>
> The suffix _Record is an equivalent to _Type.

This is the only case where I've used "Any_" as a type prefix, in Claw --  
specifically, class-wide access types.

    type Root_Window_Type is abstract tagged private;

    type Any_Window_Access_Type is access all Root_Window_Type'Class;

Access-to-classwide is a different sort of thing than access-to-specific, 
and I wanted a different sort of name for it.

For Claw, we tried to use a set of consistent prefixes and suffixes for 
declarations. We needed to get away from the terrible Hungarian names of 
Win32, but given that packages were constructed by many members of a team 
and needed a strong level of consistency, just letting everyone pick names 
was not going to be a good idea.

Jeff Carter wrote:
> I would even say that those who use naming conventions such as _T[y[p[e]]] 
> are either not S/W engineers or are shirking their duties.

I'm presuming this is typical Internet Hyperbole, as I don't think you can 
seriously say that about the designers of the Ada 83 runtime, large 
resusable sets of packages like Claw and GTK, and many others. There is an 
important value to consistency of naming in large projects, and picking 
names by "thinking", as Jeff puts it, is not going to result in that 
consistency.

Janus/Ada uses names picked Jeff's way (mostly, I've adopted the Claw rules 
for new things), and it is hard to figure out the name of something when you 
don't remember it. And an Ada compiler has a *lot* of declarations; it's 
hard to even find them in the package specs if you can't remember enough 
about the possible name for a search to work. (Janus/Ada's root go back to 
the fall of 1980, so it's common to not remember something! :-).

                                    Randy.







  reply	other threads:[~2019-12-05 23:12 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-04 13:56 Type naming conventions: Any_Foo Alejandro R. Mosteo
2019-12-04 14:52 ` Lucretia
2019-12-04 16:42   ` Alejandro R. Mosteo
2019-12-05 10:51     ` AdaMagica
2019-12-05 17:27       ` Jeffrey R. Carter
2019-12-05 17:45         ` Dmitry A. Kazakov
2019-12-05 20:03           ` Jeffrey R. Carter
2019-12-05 21:51             ` Dmitry A. Kazakov
2019-12-05 23:12               ` Randy Brukardt [this message]
2019-12-06 20:20                 ` Jeffrey R. Carter
2019-12-07  1:19                   ` Randy Brukardt
2019-12-06 20:18               ` Jeffrey R. Carter
2019-12-06 20:35                 ` Dmitry A. Kazakov
2019-12-07  0:57                   ` Randy Brukardt
2019-12-07 10:28                     ` Jeffrey R. Carter
2019-12-07 12:36                       ` Niklas Holsti
2019-12-08 12:04                         ` Jeffrey R. Carter
2019-12-07 10:13                   ` Jeffrey R. Carter
2019-12-07 11:21                     ` Dmitry A. Kazakov
2019-12-08 11:55                       ` Jeffrey R. Carter
2019-12-08 12:38                         ` Dmitry A. Kazakov
2019-12-08 14:31                         ` Shark8
2019-12-08 21:58                           ` Jeffrey R. Carter
2019-12-09 22:47                             ` Shark8
2019-12-07 23:24                     ` Jere
2019-12-08 12:14                       ` Jeffrey R. Carter
2019-12-09 22:07                         ` Randy Brukardt
2019-12-05 19:49         ` Niklas Holsti
2019-12-05 20:47           ` Jeffrey R. Carter
2019-12-05 21:33             ` Niklas Holsti
2019-12-06 11:44               ` Lucretia
2019-12-06 20:23                 ` Jeffrey R. Carter
2019-12-06 20:11               ` Jeffrey R. Carter
2019-12-06 20:46                 ` Dmitry A. Kazakov
2019-12-06 21:55                 ` Niklas Holsti
2019-12-07 10:19                   ` Jeffrey R. Carter
2019-12-07 12:05                     ` Niklas Holsti
2019-12-08 11:59                       ` Jeffrey R. Carter
2019-12-06  8:57       ` AdaMagica
2019-12-06  9:55         ` J-P. Rosen
2019-12-06 15:30       ` Optikos
2019-12-07  3:34 ` Shark8
replies disabled

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