|
![](/i/fill.gif) |
Darren New <dne### [at] san rr com> wrote:
> But that's kind of the point. Why do you think that? Saying "order
> shouldn't matter because it's a set" is begging the question.
A set in the mathematical sense has no order. If the guy wants order, he goes
for a list. PHP only got array, so it has to play many roles.
> Why does order matter in argument lists, if the arguments all need distinct
> names anyway? :-)
I think it has to do with pragmatism: it's just simpler to go with a list than
a hash.
In math, you have a function over domains and you have to make sure each
argument belongs to each domain and the simplest way to notate this is to give
the order of the domains and pass the arguments to the function in that order.
Had they opted for a named argument notation, you'd not need order, but on the
other hand you'd need a lot more typing. Programming language designers were
conscious of that and just stacking them as they come is much easier than
unwrapping hash values.
Named arguments is a thing of a hip generation used to lots of cheap computing
power and general resources. It's not as costly anymore to be verbose when
your tools happily churn it out for you.
Post a reply to this message
|
![](/i/fill.gif) |