Why do some attributes start with '@' while others done't?
Jonathan M Davis via Digitalmars-d
digitalmars-d at puremagic.com
Fri Jan 22 01:46:47 PST 2016
On Thursday, 21 January 2016 at 23:25:01 UTC, Era Scarecrow wrote:
> On Thursday, 21 January 2016 at 23:18:16 UTC, tsbockman wrote:
>> Adding the @ to the old attributes was discussed as well, but
>> it didn't seem worth the code breakage.
>
> I have to wonder if it would be that bad, since if you're
> aware of where it breaks (which source code) wouldn't a bulk
> search/replace of the sources to resolve that?
It's never even been generally agreed upon that making it so that
all attributes have @ on them is desirable, even if code breakage
isn't taken into account. Do you want stuff like @public,
@static, @final, etc.? It gets ugly really fast, and it makes
porting code from other languages gratuitously worse. Not using @
on any attributes would be far cleaner, but it would eat up more
keywords, and we arguably have too many of those already. There
really isn't a choice here that isn't ugly in some manner. So,
even if we were starting from scratch, it's not clear what we
would do.
So, it's questionable that making a change would even really be
an improvement, and if that's the case, it's definitely not worth
the code breakage.
And really, the worst that generally happens with what we have
right now is that someone occasionally asks why some attributes
start with @ and some don't.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list