Future of memory management in D

Atila Neves atila.neves at gmail.com
Sat Nov 20 16:42:02 UTC 2021


On Friday, 19 November 2021 at 10:21:35 UTC, Max Samukha wrote:
> On Thursday, 18 November 2021 at 19:32:36 UTC, Atila Neves 
> wrote:
>
>>
>> Works with `ref prop() { return _fld; }`.
>
> The whole point of properties is to hide private state.

I don't agree - I think the point is to treat getters like state.

> Exposing a private member for direct mutation is generally a 
> bad idea.

I agree wholeheartedly. Getters are a code smell, setters stink.



More information about the Digitalmars-d mailing list