comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: procedure Make_File_Gone (Name : in String);
Date: Mon, 25 Jul 2011 08:49:41 -0700 (PDT)
Date: 2011-07-25T08:49:41-07:00	[thread overview]
Message-ID: <d85d5f62-76fa-4efb-8dc1-6da95d1df7fd@t8g2000prm.googlegroups.com> (raw)
In-Reply-To: m2k4b8zoux.fsf@pushface.org

On Jul 23, 2:08 pm, Simon Wright <si...@pushface.org> wrote:
> "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de> 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.)

                              -- Adam




  reply	other threads:[~2011-07-25 15:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-20  6:04 procedure Make_File_Gone (Name : in String); tmoran
2011-07-20  7:03 ` Oliver Kleinke
2011-07-20  7:12 ` Niklas Holsti
2011-07-20  7:34 ` Martin
2011-07-20 18:02 ` Jeffrey Carter
2011-07-21  7:56 ` Stephen Leake
2011-07-22 23:44 ` Randy Brukardt
2011-07-23  2:16   ` tmoran
2011-07-23 14:55     ` Robert A Duff
2011-07-23 19:05       ` tmoran
2011-07-23 20:23         ` Dmitry A. Kazakov
2011-07-23 21:08           ` Simon Wright
2011-07-25 15:49             ` Adam Beneschan [this message]
2011-07-25 17:28               ` Simon Wright
2011-07-25 17:44 ` marius63
2011-07-27 15:38   ` tmoran
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox