[Scilab-users] On parameters passing by name in scilab functions

tim at wescottdesign.com tim at wescottdesign.com
Tue Feb 28 00:07:25 CET 2017


On 2017-02-27 11:18, Samuel Gougeon wrote:
> Le 27/02/2017 à 19:49, Tim Wescott a écrit :
>> You misread my comments.  Tim _likes_ named parameters.  If Tim were 
>> on
>> the C++ standards committee (which is as likely as pigs flying, BTW)
>> Tim would agitate that named parameters be adopted into that language.
>>   Scilab, Verilog, and (I think) VHDL have it, and particularly in a
>> language that allows for optional parameters, I feel that when you 
>> have
>> to have function calls with more than a few parameters it vastly aids
>> code readability.
> Sorry for my misinterpretation.
> I agree that it is easier to use named parameters rather than to have
> to count and feed many "empty" or default positions to reach useful
> trailing ones. But when a parameter has been badly named when
> designing the function (*), then it is done and over. We must bear it
> all the time. And this is not nice at all.
> Same thing when you want to add a parameter that has a meaning close
> to another already existing one. Then keeping things (names) clear may
> become hard. Moreover, things get more complicated when using varargin
> (that ignores names).
> 
> (*) this is often the case. Scilab misses a standards committee, also
> to well name things.

Yet even knowing all of that, and agreeing with most of it I would still 
vote for named parameters.  Even with the difficulties around varargin.




More information about the users mailing list