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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7eef1e530c6ffb21 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!t8g2000prm.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: procedure Make_File_Gone (Name : in String); Date: Mon, 25 Jul 2011 08:49:41 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <1jwu3j82n0sum.cwkjpptkwms.dlg@40tude.net> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1311610470 25659 127.0.0.1 (25 Jul 2011 16:14:30 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 25 Jul 2011 16:14:30 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: t8g2000prm.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: ARLUEHNKC X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:20347 Date: 2011-07-25T08:49:41-07:00 List-Id: On Jul 23, 2:08=A0pm, Simon Wright wrote: > "Dmitry A. Kazakov" writes: > > > On Sat, 23 Jul 2011 19:05:02 +0000 (UTC), tmo...@acm.org wrote: > > >> I'm looking for a good name for such a routine, where "good" means > >> short and clear to a maintenance programmer scanning the code. =A0Perh= aps > >> English doesn't have a nice way of making such an imperative->declarat= ive > >> phrase. > > > =A0 =A0procedure Delete_File (File : String; Existing : Boolean :=3D Tr= ue); > > =A0 =A0procedure Delete_File (File : String; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Only_If_Existing : Bo= olean :=3D True); Or you could go the other way: procedure Delete_File (File : String; OK_If_File_Doesnt_Exist : Boolean :=3D False); The parameter name is clunky. Still, I think I'd slightly prefer something along those lines because I tried to read a call that looks like this: Delete_File (F, Only_If_Existing =3D> False); I'd be scratching my head trying to figure out what it meant. It's probably better to use names that mean nothing: Delete_File (F, Glarfspoogl =3D> False); than to use names that look like they're intended to convey meaning but actually are just confusing. The former at least will force readers to go back and look at the documentation. (I'm only half- serious here. I don't recommending using ridiculous names like Glarfspoogl.) -- Adam