Path: utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-pcd!hplsla!jima
From: jima@hplsla.HP.COM (Jim Adcock)
Newsgroups: comp.lang.c++
Subject: Re: Named arguments?
Message-ID: <6590229@hplsla.HP.COM>
Date: 16 Aug 89 17:25:15 GMT
References: <2179@uw-entropy.ms.washington.edu>
Organization: HP Lake Stevens, WA
Lines: 34

Seems to me passing everything in long function parameter lists, so
long that you need to give parameters names, offer a zillion options, etc,
etc, is the antithesis of object oriented programming, and is just the 
opposite direction of where C++ programming should be going.

Instead, all those parameters and options should be represented in the
state of the underlying object, not represented a gigantic list of options
to one function.  Options are invoked by calling a method, with perhaps
a parameter or two, to turn on that option.  The option being turned on
is uniquely represented by the name of the method called -- not the name
of a named argument supplied to that option.  Defaults are established
by the constructor to an object, so that optional methods need not be
called for standard usage.

	someClass myObject;

	myObject.someOption;
	myObject.someParameter(paramvalue);
	myObject.someOption(withAParameter);

	myObject.doSomething;

As opposed to:

	doSomething(myStructure, someOption=TRUE, someParameter=paramvalue,
			someParameteredOption=withAParameter);

Long parameter list simply indicate one is still doing functional programming
rather than object oriented programming.  99.9% of object oriented programming
should be done with zero, one, or two parameters.  The simple default 
parameter capabilities built into C++ handle these cases well.  Named 
parameters would simply encourage people to continue hack functional 
programming, rather than making the mental switch to object oriented
programming.