Jump to page: 1 2 3
Thread overview
Why do some language-defined attributes have @ and some not?
Oct 22, 2014
Shriramana Sharma
Oct 22, 2014
Jonathan M Davis
Oct 23, 2014
Shriramana Sharma
Oct 23, 2014
Jonathan M Davis
Oct 23, 2014
Shriramana Sharma
Oct 23, 2014
Paolo Invernizzi
Oct 23, 2014
H. S. Teoh
Oct 23, 2014
Gary Willoughby
Oct 24, 2014
Chris Williams
Oct 25, 2014
Jonathan M Davis
Oct 23, 2014
ketmar
Oct 23, 2014
ketmar
Oct 23, 2014
Jonathan M Davis
Oct 23, 2014
ketmar
Oct 23, 2014
Jonathan M Davis
Oct 24, 2014
Mike Parker
Oct 24, 2014
Paolo Invernizzi
Oct 24, 2014
Jonathan M Davis
Oct 24, 2014
Shriramana Sharma
Oct 24, 2014
Gary Willoughby
October 22, 2014
Hello. See http://dlang.org/attribute. 3 attributes starting at http://dlang.org/attribute#disable have a @ in front. Apparently safe, trusted and system also do, though these are documented elsewhere: http://dlang.org/function.html#function-safety.

Why are some language-defined attributes starting with @ and others not? Wouldn't it be consistent and less-confusing to, say, only use @ for user-defined attributes and not these language-defined ones?

-- 
Shriramana Sharma ஶ்ரீரமணஶர்மா श्रीरमणशर्मा

October 22, 2014
On Wednesday, 22 October 2014 at 19:13:58 UTC, Shriramana Sharma via Digitalmars-d-learn wrote:
> Hello. See http://dlang.org/attribute. 3 attributes starting at
> http://dlang.org/attribute#disable have a @ in front. Apparently safe,
> trusted and system also do, though these are documented elsewhere:
> http://dlang.org/function.html#function-safety.
>
> Why are some language-defined attributes starting with @ and others
> not? Wouldn't it be consistent and less-confusing to, say, only use @
> for user-defined attributes and not these language-defined ones?

It's a historical thing. Walter didn't want to add more keywords, so we put @ in the front of some of the new ones. User-defined attributes didn't even exist at the time. Those were added far later. It would be nice if none of the built-in attributes had @ on them, but it's far too late now. And by the way, there's also @property, so there's four of them with @.

- Jonathan M Davis
October 23, 2014
I thought D was beyond carrying historical baggage. DMD 2.x is not necessarily language-compatible with DMD 2.(x+1) since the language is still evolving. You can deprecate one syntax and enforce the other in a later version.

I submit that the syntax for attributes should be streamlined. Shall I go and open a Bugzilla item?

-- 
Shriramana Sharma ஶ்ரீரமணஶர்மா श्रीरमणशर्मा

October 23, 2014
On Thursday, 23 October 2014 at 00:59:26 UTC, Shriramana Sharma via Digitalmars-d-learn wrote:
> I thought D was beyond carrying historical baggage. DMD 2.x is not
> necessarily language-compatible with DMD 2.(x+1) since the language is
> still evolving. You can deprecate one syntax and enforce the other in
> a later version.
>
> I submit that the syntax for attributes should be streamlined. Shall I
> go and open a Bugzilla item?

LOL. I understand the sentiment, but it's a waste of time. We've long since reached the point where we try and not break people's existing code unless we have a really good reason for it (and for better or worse, aesthetics definitely don't make the cut). No, D2 is not as fixed in stone as C++ is, but we are trying to have a stable enough language for programmers to use in production rather than treating the language as being experimental and/or rapidly changing in incompatible ways.

So, yes, we do have historical baggage, albeit nowhere near as much as C++ does. But the reality of the matter is that _every_ language that gets used in production has historical baggage, because you never get everything right, and you frequently can't afford to change it, because it would break too many existing programs. And for better or worse, fixing attribute names doesn't even come close to being on the list of things that Walter Bright would consider worth changing. It's hard enough to get him to agree to make breaking changes when most of us agree that we'll be better off with the changes in spite of the code breakage that they cause, let alone on a controversial topic like attribute names which has been discussed to death.

Walter and Andrei very much want D to be being used in production at this point, and so the focus on features is entirely on what's required to make the language fully usuable for companies looking to use D, and tweaking things to make them cleaner just isn't going to happen without a really good, practical reason for it. Breaking changes are sometimes made still, but not for something like that

- Jonathan M Davis
October 23, 2014
On 10/23/14, Jonathan M Davis via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com> wrote:
> So, yes, we do have historical baggage, albeit nowhere near as much as C++ does.

OK understood, but I may just go and file that bug so that if there is a future D 3 series, then stuff like this can be cleaned up. :-) I'm finicky like that! ;-)

> Walter and Andrei very much want D to be being used in production at this point,

We all do, no? Not only those two! :-)

So I agree with you that for now this is not an urgent need. I guess when we clean out all that !> <>= stuff this can be done too, or something like that...

-- 
Shriramana Sharma ஶ்ரீரமணஶர்மா श्रीरमणशर्मा

October 23, 2014
On Thursday, 23 October 2014 at 02:22:41 UTC, Jonathan M Davis wrote:
> On Thursday, 23 October 2014 at 00:59:26 UTC, Shriramana Sharma via Digitalmars-d-learn wrote:
>
> LOL. I understand the sentiment, but it's a waste of time.

Jonathan,

I agree It's impossible to debate such thing with Walter / Andrej right now, but I don't think It's a waste of time: every explicit and accountable opinion about that is a little stone to weigh in the balance.

---
/Paolo
October 23, 2014
On Thu, Oct 23, 2014 at 10:50:07AM +0530, Shriramana Sharma via Digitalmars-d-learn wrote: [...]
> So I agree with you that for now this is not an urgent need. I guess when we clean out all that !> <>= stuff this can be done too, or something like that...
[...]

I believe those flying-saucer operators (:-P) are slated for removal. IIRC, Walter has recently actually made some PRs to deprecate those operators, which means in a couple o' releases they should finally be gone for good.


T

-- 
Shin: (n.) A device for finding furniture in the dark.
October 23, 2014
On Thu, 23 Oct 2014 06:29:12 +0530
Shriramana Sharma via Digitalmars-d-learn
<digitalmars-d-learn@puremagic.com> wrote:

> I submit that the syntax for attributes should be streamlined. Shall I go and open a Bugzilla item?
hehe.
https://issues.dlang.org/show_bug.cgi?id=13388
https://issues.dlang.org/show_bug.cgi?id=13397
i must admit that there were NO "code breaking" in both of that, and
in NG discussion people telling about newcomers asking "why that '@'
is here but not there".

besides, no "serious" language can live without "legacy". legacy is a sign of maturity. ;-)


October 23, 2014
On Thursday, 23 October 2014 at 00:59:26 UTC, Shriramana Sharma via Digitalmars-d-
> I submit that the syntax for attributes should be streamlined. Shall I
> go and open a Bugzilla item?

No need: http://wiki.dlang.org/DIP64
October 23, 2014
On Thursday, 23 October 2014 at 06:59:16 UTC, ketmar via Digitalmars-d-learn wrote:
> besides, no "serious" language can live without "legacy". legacy is a sign of maturity. ;-)

So you are basically saying that D is a teenager for whom wearing ugly make-up is a sign of maturity?
« First   ‹ Prev
1 2 3