Blog post: What D got wrong

0xEAB desisma at heidel.beer
Tue Dec 11 13:08:18 UTC 2018


On Tuesday, 11 December 2018 at 12:57:03 UTC, Atila Neves wrote:
> On Tuesday, 11 December 2018 at 12:52:20 UTC, Adam D. Ruppe 
> wrote:
>> On Tuesday, 11 December 2018 at 10:45:39 UTC, Atila Neves 
>> wrote:
>>> A few things that have annoyed me about writing D lately:
>>>
>>> https://atilanevesoncode.wordpress.com/2018/12/11/what-d-got-wrong/
>>
>> If @property worked for a thing to return a delegate, it would 
>> be useful.
>>
>> But noooo, we got worked up over syntax and forgot about 
>> semantics :(
>
> @property is useful for setters. Now, IMHO setters are a code 
> stink anyway but sometimes they're the way to go. I have no 
> idea what it's supposed to do for getters (nor am I interested 
> in learning or retaining that information) and never slap the 
> attribute on.

Well, one can use it for optics :)


@property
{
     int x()
     {
         return this._x;
     }

     void x(int value)
     {
         this._x = value;
     }
}


More information about the Digitalmars-d-announce mailing list