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: 103376,c39ad3e35a7690a9 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Received: by 10.68.135.231 with SMTP id pv7mr6295461pbb.8.1328988247992; Sat, 11 Feb 2012 11:24:07 -0800 (PST) Path: wr5ni13322pbc.0!nntp.google.com!news2.google.com!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Convention for naming of packages Date: Sat, 11 Feb 2012 20:24:06 +0100 Organization: Ada @ Home Message-ID: References: <4f355230$0$21451$ba4acef3@reader.news.orange.fr> NNTP-Posting-Host: cOsGXo1g/JfIRrlUYM+jrg.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/11.61 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable Date: 2012-02-11T20:24:06+01:00 List-Id: Le Sat, 11 Feb 2012 11:17:41 +0100, Yannick Duch=C3=AAne (Hibou57) = a =C3=A9crit: > Le Sat, 11 Feb 2012 10:22:18 +0100, Simon Wright = a = > =C3=A9crit: >> In most cases the subprogram name tells what it does, and the object >> parameter might just as well be called 'This'. Finally I will either not keep this one, or else, complete it. "This" = as=E2=80=91as and alone, don't map well on all subprograms. Fine with that: Print (This =3D> =E2=80=A6); -- Operation Update (This =3D> =E2=80=A6); -- Operation But not with that: Set_Weight (This =3D> =E2=80=A6, Value =3D> =E2=80=A6); -- Setter Weight (This =3D> =E2=80=A6); -- Getter Relation (This =3D> =E2=80=A6, Foo =3D> =E2=80=A6); -- Expressio= n An solution could be: Set_Weight (On =3D> =E2=80=A6, Value =3D> =E2=80=A6); -- Setter Weight (Of =3D> =E2=80=A6); -- Getter Relation (From =3D> =E2=80=A6, Foo =3D> =E2=80=A6); -- Expression (so far, don't care about the other choice needed for "Of" which is a = reserved word) This do not name things, and try to mimic English grammar= . = Same comment with "This". This/On/Of/From don't look like object names, = = they mimic natural language. Good or bad? I'm hesitating, and have both = = feeling at the same time. In any case, if things needs all to be properly named, naming from the = user point of view, ends into bad name from the implementation/self poin= t = of view. So a corresponding renaming could be advisable in implementatio= n. Ex. Me : constant Instance_Type renames This; Me : constant Instance_Type renames On; Me : constant Instance_Type renames Of; Me : constant Instance_Type renames From; Would be rather pleasant to read and unlikely to make people shout "Hey,= = that's too much wordy! That's just bloat!". What's your feeling? -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [1] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [1] [1]: Epigrams on Programming =E2=80=94 Alan J. =E2=80=94 P. Yale Univers= ity