Properties

Michiel Helvensteijn nomail at please.com
Thu Jan 8 09:33:54 PST 2009


Ary Borenszweig wrote:

>>> get { return this.len; }
>>> set { this.len = value; } // "value" (like in C#), or "$" or something
>>> like that
>> 
>> I have to disagree. By that logic, we would abolish parameter-names
>> altogether and access formal parameters by number. set has a parameter,
>> and the programmer should be able to name it.
> 
> It's very different. A setter has a very specific meaning: set some
> value. That's why it's called "value". Another name could be the name of
> the property ("len") or something like "newLen". Which other name would
> you use?

It's not for me to say. It should be up to the programmer.

You've already shown that there are at least three possibilities.

-- 
Michiel




More information about the Digitalmars-d mailing list