@property for simple methods?

Vladimirs Nordholm v at vladde.net
Tue Apr 3 18:49:45 UTC 2018


On Monday, 2 April 2018 at 15:15:05 UTC, Dennis wrote:
> On Monday, 2 April 2018 at 14:51:57 UTC, Vladimirs Nordholm 
> wrote:
>> Do you think I should I omit the @property tag, if the only 
>> wanted behaviour is to set a value (`foo.bar = "baz";`) ?
>
> You're probably fine either way, it's mostly for making your 
> intention clear. Jonathan M Davis made a great explanation:
> (https://forum.dlang.org/post/mailman.709.1481234980.9448.digitalmars-d-learn@puremagic.com)

His reasoning is the same as mine. I only have the @property as 
documentation :)


More information about the Digitalmars-d-learn mailing list