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

Dicebot m.strashun at gmail.com
Mon Jan 28 09:30:39 PST 2013


On Monday, 28 January 2013 at 17:14:31 UTC, TommiT wrote:
> 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.

That is no different from volatile variables. My notion is at 
least same as C# guideline authors, so it should be not that 
rare. It all comes from "property == variable" mantra.


More information about the Digitalmars-d mailing list