From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!paganini.bofh.team!newsfeed.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Type naming conventions: Any_Foo Date: Thu, 5 Dec 2019 17:12:57 -0600 Organization: JSA Research & Innovation Message-ID: References: Injection-Date: Thu, 5 Dec 2019 23:12:59 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="29244"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader01.eternal-september.org comp.lang.ada:57664 Date: 2019-12-05T17:12:57-06:00 List-Id: "Dmitry A. Kazakov" 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.