Property discussion wrap-up

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Jan 28 05:49:16 PST 2013


On 1/28/13 8:40 AM, Dicebot wrote:
> On Monday, 28 January 2013 at 13:37:36 UTC, Andrei Alexandrescu wrote:
>> If we talk about _reasoning_, then properties have already broken that
>> because a.b may be a function invocation. Probably it's about
>> something weaker.
>>
>> Andrei
>
> No, it has been stated few times already (actually I have just given
> answer to the same question to Adam) - properties should be reasoned AS
> IF they are fields/variables, by design. They are
> abstraction/encapsulation tools and their implementation details should
> not matter to the reader. You see property - you assume it is as field,
> because it looks like one.

But this gets back to faith-based programming. I associate "reasoning" 
with much more rigorous processes.

> That is why having .length of array as a property that reallocates is so
> horrible.

Well it's worked hasn't it.


Andrei


More information about the Digitalmars-d mailing list