New in C#4
dsimcha
dsimcha at yahoo.com
Wed Oct 29 08:18:40 PDT 2008
== Quote from bearophile (bearophileHUGS at lycos.com)'s article
> They have used colons:
> foo(x: 1, z: 3)
> While Python uses equal signs:
> foo(x=1, z=3)
> I think they are about equally readable.
> (I think there's a problem with named arguments, that you can solve in some
ways, for example with an extra hidden bitfield argument that encodes what
arguments are given and what not).
> Bye,
> bearophile
Vote++ for named arguments. I've been meaning to bring this up for a while.
Given that it's a pure syntactic sugar feature and therefore shouldn't cause any
significant ripple effects (at least none that I'm aware of) and greatly
simplifies design and use of APIs with lots of optional parameters, I think it's a
no brainer.
More information about the Digitalmars-d
mailing list