Pretty please: Named arguments

spir denis.spir at gmail.com
Tue Mar 1 04:05:30 PST 2011


On 03/01/2011 02:48 AM, Andrei Alexandrescu wrote:
> On 2/28/11 6:03 PM, Jonathan M Davis wrote:
>> The more I think about this, the more I'm against the idea of named arguments.
>
> I think you have been blessed to work with only small, clean APIs. Certain
> domains definitely promote large argument lists. Though the designs could
> certainly be refactored to e.g. group parameters into separate objects, it's
> overkill to do that. I'm afraid sheer experience is showing that your
> counterarguments are not based.

It seems to me the core point is whether what params mean, and their order, is 
obvious. Rather than their sheer number. Reading code using names for params is 
a huge help in understanding it, and also in learning the APIs. Meaning what 
one can do, why it is useful, and how to proceed concretely.
I would be for all tutorial-like code (esp in "official" ref doc), examples, 
and even unittests more or less intended as code samples, to use named params 
everywhere.

Denis
-- 
_________________
vita es estrany
spir.wikidot.com



More information about the Digitalmars-d mailing list