new DIP5: Properties 2
Benji Smith
dlanguage at benjismith.net
Fri Jul 31 21:28:56 PDT 2009
Andrei Alexandrescu wrote:
> Steven Schveighoffer wrote:
>> So to sum up, with this feature lack of parentheses would imply no
>> action, but would not be enforced. However, it would be considered
>> incorrect logic if the rule was not followed, similar to naming your
>> functions something other than what they do.
>
> I am leery of such a feature. It essentially introduces a way to define
> conventions that are in no way useful to, or checked by, language rules.
> In my experience this has been a bad idea more often than not.
Like it or not, that's exactly the situation we have now, with the
(sometimes)-optional parentheses. Some people are using a convention of
never using the optional parens. Other people use the parens only when a
function an action, and avoiding them otherwise. And some other people
(like me) always use the parens.
So the clusterfuck of unenforceable and useless conventions is already
here. Here's my suggestions: if you think putting parentheses on a
no-arg function is stupid, then it should be a syntax error for them to
exist. That wouldn't be my first choice, but it'd be a thousand times
better than the situation with optional parens.
--benji
More information about the Digitalmars-d
mailing list