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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,25d835bb9a4a003f X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,CP1252 Path: g2news1.google.com!postnews.google.com!c34g2000yqn.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Hibou57_=28Yannick_Duch=EAne=29?= Newsgroups: comp.lang.ada Subject: Re: Types, packages & objects : the good old naming conventions question (without religious ware) Date: Thu, 7 Jan 2010 07:20:27 -0800 (PST) Organization: http://groups.google.com Message-ID: <1d21c9fe-4c11-4c00-ab85-b798344431fa@c34g2000yqn.googlegroups.com> References: <561e0a4a-c6c0-42db-9f31-a70f4eae1ed9@a21g2000yqc.googlegroups.com> <-9ydneBa_O8wB2TXnZ2dnUVZ_tadnZ2d@earthlink.com> <0ef44c2d-3848-4780-8663-f5f96efc7638@k19g2000yqc.googlegroups.com> <4b3b1dea$0$6716$9b4e6d93@newsspool2.arcor-online.net> NNTP-Posting-Host: 77.198.58.228 Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1262877627 4165 127.0.0.1 (7 Jan 2010 15:20:27 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 7 Jan 2010 15:20:27 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: c34g2000yqn.googlegroups.com; posting-host=77.198.58.228; posting-account=vrfdLAoAAAAauX_3XwyXEwXCWN3A1l8D User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; fr),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:8648 Date: 2010-01-07T07:20:27-08:00 List-Id: On 30 d=E9c 2009, 10:31, Georg Bauhaus wrote: > Are you certain that the removal of abstraction---by adding > type properties to object names---will help when trying to > understand a program? =A0It might rather give the quick reader > the impression of understanding the program from just a look > at the objects' names, I think. =A0An illusion, most likely, > for how could you make meaningful changes to a program by > knowing just little things like "this is a tagged type" from > looking at object names? On 31 d=E9c 2009, 14:48, Marco wrote: > I agree - for code to be reusable in the long run it should have some > level of abstraction - specification distinguished from implementation > including public types > > =A0 adding awful "Hungarian" names does not help Ada You are both right, this would be too much, just because the added value is below the level of the added noise. Doing too much does not help to a convention to gain audiance. Just a comment =93 tout-de-m=EAme =94 : On 31 d=E9c 2009, 14:48, Marco wrote: > =A0 adding awful "Hungarian" names does not help Ada This never had anything to deal with the Hungarian notation, which recalls type information in instance names. This mostly has to deal with the determination of a name which cleanly match and express the role of an entity. Types does not play the same role as instances does, and moreover (and the biggest point) as previously pointed, there is in Ada, no separate name spaces for type names and instance names. As I'm there, here is the opportunity to introduce another usage case : there is a another trick similar to the one of type-name against instance-name which I oftenly encounter : a constant or a variable whose most obvious name would be the same as a function, which by the way, is in most of case used to initialize it. To have a legal source is much more easy than to have a beautiful source, and although =97 providing a function F exist =97 if I would like to name a variable F which would be initialized with something returned from F, using F_Value for the variable name or Get_F for the function name, in the sole purpose to avoid a naming clash, ends up in a legal source, but not a pretty-beautiful source. Packaging and package name prefix may help here (coming with a name space), but only when there are other good reasons to have this package. Well, if F is a variable, this can be declared, and later initialized in a named block instead of from a function (although it seems less clean to me). But what about when F is an initialized constant ? I do not know any nice way (not an Ada flaw, as legal Ada source allows to do what is to be done as specified, just a matter of aesthetic =97 which in turns influence the feeling of readability).