Blog post: What D got wrong
12345swordy
alexanderheistermann at gmail.com
Tue Dec 11 14:12:54 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.
My view of getters is that they serve as a contract of between
contractor and client stating "You can't modify this value, I
however can".
More information about the Digitalmars-d-announce
mailing list