Blog post: What D got wrong

Guillaume Piolat first.last at gmail.com
Tue Dec 11 13:42:03 UTC 2018


On Tuesday, 11 December 2018 at 13:08:18 UTC, 0xEAB wrote:
>
> Well, one can use it for optics :)
>
>
> @property
> {
>     int x()
>     {
>         return this._x;
>     }
>
>     void x(int value)
>     {
>         this._x = value;
>     }
> }

One could say getters and particularly setters don't really 
deserve a nicer way to write them. It's a code stink, it deserve 
a long ugly name.  (10 years ago I would be in the other camp)


More information about the Digitalmars-d-announce mailing list