comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: [OT] interesting reason why a language is considered good
Date: Tue, 17 Apr 2012 18:15:04 +0200
Date: 2012-04-17T18:15:04+02:00	[thread overview]
Message-ID: <146segtlt6uuq$.uhujfbcu0yuf.dlg@40tude.net> (raw)
In-Reply-To: m27gxel5q0.fsf@pushface.org

On Tue, 17 Apr 2012 16:48:23 +0100, Simon Wright wrote:

> "Randy Brukardt" <randy@rrsoftware.com> writes:
> 
>> Unfortunately, this solution makes insanely wordy calls:
>>
>>     Leave (Scheduled_Departure => Now);
>>
>> In many cases, the parameter names overwhelm the actual values. The
>> "solution" usually used is to omit them from the calls altogether,
>> reducing readability and understandability.
> 
> Your "insanely wordy" is my "perfectly natural"!
> 
>    procedure Serve (Using_Port : GNAT.Sockets.Port_Type;
>                     At_Priority : System.Priority := System.Default_Priority;
>                     With_Stack : Positive := 20_000;
>                     Logging_Via : Logger := null;
>                     Tracing : Boolean := False);
> 
> called as
> 
>    Serve (Using_Port => 8080,
>           With_Stack => 40_000,
>           Tracing => Verbose);
> 
> Now that I look at them, both would probably be improved with a bit of
> alignment:
> 
>    Serve (Using_Port => 8080,
>           With_Stack => 40_000,
>           Tracing    => Verbose);

Why not "With_Tracing" then? In "Using_Port" "Using" is just noise, as well
as "With" in "With_Stack."

My take would be:

   Serve (Port => 8080, Max_Stack_Depth => 40_000, Tracing_Level =>
Verbose);

P.S. I would never use an abstraction with side-effects. I.e. Serve would
become an operation of some explicit Connection, Worker etc object keeping
the state.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2012-04-17 16:15 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-15 10:27 [OT] interesting reason why a language is considered good Nasser M. Abbasi
2012-04-15 11:57 ` J-P. Rosen
2012-04-16 10:37   ` Peter C. Chapin
2012-04-15 12:27 ` Dmitry A. Kazakov
2012-04-17  6:59   ` tonyg
2012-04-17  7:43     ` Dmitry A. Kazakov
2012-04-15 14:05 ` Bill Findlay
2012-04-15 14:21 ` Pascal Obry
2012-04-15 14:54   ` Simon Wright
2012-04-15 15:34     ` Pascal Obry
2012-04-17  5:42       ` Brad Moore
2012-04-17 16:11         ` Simon Wright
2012-04-17 16:33           ` Robert A Duff
2012-04-17 19:34             ` Simon Wright
2012-04-17 21:42               ` Robert A Duff
2012-04-17 22:24                 ` Randy Brukardt
2012-04-18  7:00                   ` stefan-lucks
2012-04-17 21:17             ` Jeffrey Carter
2012-04-15 23:53     ` Brian Drummond
2012-04-16 10:43 ` Marius Amado-Alves
2012-04-16 11:48   ` Georg Bauhaus
2012-04-16 13:06     ` Dmitry A. Kazakov
2012-04-16 15:01       ` Georg Bauhaus
2012-04-16 15:31         ` Dmitry A. Kazakov
2012-04-16 17:11           ` Georg Bauhaus
2012-04-16 17:19             ` Georg Bauhaus
2012-04-16 18:00             ` Dmitry A. Kazakov
2012-04-16 21:48               ` Georg Bauhaus
2012-04-17  3:43                 ` Randy Brukardt
2012-04-17  4:43                   ` Bill Findlay
2012-04-17  7:46                   ` Georg Bauhaus
2012-04-17 22:32                     ` Randy Brukardt
2012-04-18  7:10                       ` stefan-lucks
2012-04-18 23:48                         ` Randy Brukardt
2012-04-19 14:22                           ` Shark8
2012-04-17 15:48                   ` Simon Wright
2012-04-17 16:15                     ` Dmitry A. Kazakov [this message]
2012-04-17 19:33                       ` Simon Wright
2012-04-17  7:34                 ` Dmitry A. Kazakov
2012-04-17 16:01                   ` Simon Wright
2012-04-17 17:42                   ` Georg Bauhaus
2012-04-17 19:17                     ` Dmitry A. Kazakov
2012-04-17  3:24           ` Randy Brukardt
2012-04-17  3:33           ` Randy Brukardt
2012-04-16 19:55   ` sbelmont700
2012-04-17  0:48   ` Peter C. Chapin
2012-04-17 21:59 ` anon
2012-05-13  4:14   ` David Thompson
replies disabled

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