D's "accessors" are like abusing operator overloads
Nick Sabalausky
a at a.a
Fri Mar 27 11:09:38 PDT 2009
"Simen Kjaeraas" <simen.kjaras at gmail.com> wrote in message
news:op.urfzx0ia1hx7vj at biotronic-pc.osir.hihm.no...
>
> One could argue that auto foo = TimeSpan.seconds = 30; looks weird, but
> writing weird code is in no way dependent on property syntax.
>
True, but a function's/class's/data-member's interface shouldn't help
facilitate weird code. The creator of the function/class/data-member knows
the semantics of whatever interface they're creating, so *they* are the
proper ones who should have to choose between function syntax and property
syntax, *not* the user of the interface.
More information about the Digitalmars-d
mailing list