|
|
Kevin Wampler wrote:
> Darren New wrote:
>> Why does order matter in argument lists, if the arguments all need
>> distinct names anyway? :-)
>
> So you can call the function without explicitly naming the parameters,
> thus reducing the amount of typing required.
It was a rhetorical question to show that the argument "dictionaries are
sets and hence have no order" is an invalid comparison.
> Personally, I like the style where arguments can be passed in order (in
> which case the names don't matter) or by name (in which case the order
> doesn't matter). Python sort does this, with a few restrictions, and
> it's seemed pretty intuitive and useful to me.
Agreed.
> Thinking back, didn't objective-C use named parameters only for calling
> object methods? Did the order matter there? I can't really remember.
Yes. Because they took it from Smalltalk.
--
Darren New, San Diego CA, USA (PST)
There's no CD like OCD, there's no CD I knoooow!
Post a reply to this message
|
|