Property discussion wrap-up

deadalnix deadalnix at gmail.com
Mon Jan 28 05:38:40 PST 2013


On Monday, 28 January 2013 at 13:20:22 UTC, Andrei Alexandrescu 
wrote:
> It's a pertinent question. (I didn't know Ferrari is a crappy 
> car :o))
>
> One interesting fact is that we have evidence at hand. Optional 
> parens _exist_ today in D, and have for a while. The language 
> has worked. They haven't been a disaster. Aside from 
> discussions about @property itself, optional parens have just 
> worked. We also have evidence that UFCS is convenient and 
> useful. People use it and like it. And arguably UFCS and 
> optional parens combine in a lovely way.
>

You have to think at it both way.

In a lot of code of mine, I omit parenthesis. I don't think that 
is a good idea in general, but I have to suffer the 
inconsistencies introduced anyway, so it make sense to benefit 
from them.

> We've also converted the Phobos codebase to work with the 
> half-strong -property switch. We've adorned a lot of functions 
> with @property. I don't see evidence of found bugs or improved 
> code quality. (Subjectively, I'd argue we actually degraded 
> esthetics. There's no love lost between me and that "@property" 
> plastered everywhere.)
>

It seems to me that phobos has way too much @property in the 
first place (save for range for instance).

I'm pretty sure phobos has that much @property because they were 
implicit in the first place. Phobos state is to more the 
consequence of the laxness that existed in the first place rather 
than a problem with the later fix.

> These are not "what if" hypotheses; they describe experience 
> accumulated from past events. Even people who dislike optional 
> parens or UFCS must agree that their sentiment is far from 
> widespread - unlike, for example, was the case for string 
> lambdas.
>

I have to say I've seen many people « liking » the 
parentheses-less calls, but not many coming with actual 
arguments. You are an exception here. I usually don't trust games 
of numbers on such topics.


More information about the Digitalmars-d mailing list