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,UTF8 Path: g2news1.google.com!news3.google.com!feeder.news-service.com!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: procedure Make_File_Gone (Name : in String); Date: Mon, 25 Jul 2011 18:28:05 +0100 Organization: A noiseless patient Spider Message-ID: References: <1jwu3j82n0sum.cwkjpptkwms.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: mx04.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="4635"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX199+/ieAbc/dcuf4KHQMzX9x6F3Tdeaorc=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (darwin) Cancel-Lock: sha1:h3cOVz5OLYhokBmjyWq/GlyIQn8= sha1:fzagrPKXuysyuo7eoIfMQkkG2ag= Xref: g2news1.google.com comp.lang.ada:20348 Date: 2011-07-25T18:28:05+01:00 List-Id: Adam Beneschan writes: > On Jul 23, 2:08 pm, 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.  Perhaps >> >> English doesn't have a nice way of making such an imperative->declarative >> >> phrase. >> >> >    procedure Delete_File (File : String; Existing : Boolean := True); >> >>    procedure Delete_File (File : String; >>                           Only_If_Existing : Boolean := True); > > Or you could go the other way: > > procedure Delete_File (File : String; > OK_If_File_Doesnt_Exist : Boolean := 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 => 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 => 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.) I take your point. With_Exception_If_Not_Found : Boolean := True (we could argue this one for a long time if we had nothing better to do!)