Properties
Michiel Helvensteijn
nomail at please.com
Thu Jan 8 10:46:14 PST 2009
Nick Sabalausky wrote:
>> Perhaps the implicit declaration "value" (or whatever *you* would call
>> it) inadvertently overshadows a member variable with that name. That
>> could result in a bug that would be pretty hard to find.
>>
>
> Overshadowing is already a potential issue anyway, with or without
> properties. Even a user-defined name could still accidentally overshadow
> something.
Sure, but in that case both of the declarations are explicit. Now there's an
invisible variable blocking a visible one. Could be quite confusing.
> Also, using "$" could help minimize overshadowing, the only
> thing that could ever clash with that is the "array.length" shorthand
> inside array slices/indexes (and even that already has potential for
> clashing, specifically when using nested indexes).
Using $ just doesn't make much sense. To what lengths are you willing to go
to avoid typing a few more characters? Or do you really find $ more
readable? Who could guess that $ inside the set function stands for its
invisible parameter?
--
Michiel
More information about the Digitalmars-d
mailing list