@property - take it behind the woodshed and shoot it?

TommiT tommitissari at hotmail.com
Mon Jan 28 09:14:30 PST 2013


On Monday, 28 January 2013 at 16:50:27 UTC, Dicebot wrote:
>> And, I don't see much point in having properties that are not 
>> allowed to have any side-effects.
>
> Then you need something other than properties.

I think you're putting too much faith on the power of convention 
and on the similarity between your's and everybody else's notions 
of how much side effects a settable property can have while not 
giving the user any surprises.

Let's say your type has three properties:
#1: start_time
#2: end_time
#3: duration

Changing any one of those properties must (logically) change at 
least one other property. Therefore, you can't just pretend that 
properties are simple data fields.


More information about the Digitalmars-d mailing list