"Michel Fortin" <[email protected]> wrote in message
news:[email protected]...
On 2010-01-27 15:54:42 -0500, Andrei Alexandrescu
<[email protected]> said:
Now @property is in. That has created (as I had anticipated) the
unresolved issue of choosing between @property or just function for any
given parameterless function. Also I need to litter my code with
@property. To this day I am not sure whether we made the right decision.
Well, perhaps it'd be better if it was 'property' instead of '@property'.
I find the distinction between keywords and attributes to be pretty
arbitrary, almost illogical.
I'm on the side that attributes (those keywords starting with @) should be
reserved to things you can ignore entirely without preventing the program
from working. For instance, remove all @safe and @trusted attributes from
a program and it still works with no change in behaviour (except for when
an error occurs). 'nothrow', 'pure', 'final', 'deprecated' should be
attributes; '@property' should be a regular keyword. Protection attributes
could be made attributes too since if you remove them all everything still
works.
So I think attributes should be reserved to non-essential but useful stuff
in the language, generally those things adding restrictions without
changing the semantics.
Yes, agreed, there should be some more thought put into how keywords work so
that things are consistent and make sense. It seems strange that new
keywords are preceded by @, but older ones are not. However, aesthetically,
I prefer the @ to a double underscore. Perhaps __gshared could be @gshared
or even @shared.
-Craig
-Craig