Date: Tue, 10 Feb 2026 01:17:14 +0100
Hi Jason,
On 2026-02-09T18:33:06-0500, Jason McKesson via Std-Proposals wrote:
> > The good thing about attributes is that placing rules are clear. If we
> > add new keywords, that increases syntax complexity. Using scopes
> > attributes, the syntax stays untouched.
>
> That's nice for computer usability and readability, but it does
> nothing for *human* usability and readability. Indeed, it makes those
> things worse.
I'm going to strongly disagree. I still remember the first time I saw
a function-like keyword in some source code, back when I was learning C.
I don't remember the exact keyword, but I remember it was a vendor
attribute in a function declaration. It was something like this:
void foo(int a) bar();
You can imagine me --a then inexpert C programer-- thinking "WTF is
this?!". What's the function? What are its parameters? Does it have
one parameter 'a'? Or no parameters? Is it called foo() or bar()?
With attributes syntax, it would have been
void foo(int a) [[bar()]];
Which anyone knowing that [[]] encloses attributes would recognize as
"this somehow modifies the declaration; look the documentation for the
precise attribute for the details".
>
> The attribute syntax was introduced with the understanding that they
> would be ignorable. They could have Godawful syntax because you
> weren't supposed to interact with them that much.
I don't think it's awful. I like _Upper and __lower just fine, and
don't think [[attr]] is much worse than that. You get used to the
spelling of things. FWIW, I use _Generic() often, and never felt the
need for a generic() macro wrapping that.
> That's why the
> `[[override]]` and `[[final]]` attributes became the `override` and
> `final` contextual keywords, and all of our lives were made better
> because of that.
>
> Attributes are supposed to be rarely used tools for very specific
> communication with compilers, not replacements for keywords because
> it's easier to standardize an attribute than an actual keyword.
And they should remain rarely used.
FWIW, I don't use _Alignas() often, and I think it would be much better
as an attribute [[::alignas()]]. I never remember where _Alignas()
goes in a declaration. But if it were an attribute, I'd only need to
remember the rules for attributes, which are relatively simple.
Have a lovely night!
Alex
>
> If C++ needs an easy way to introduce keywords, then add that.
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
On 2026-02-09T18:33:06-0500, Jason McKesson via Std-Proposals wrote:
> > The good thing about attributes is that placing rules are clear. If we
> > add new keywords, that increases syntax complexity. Using scopes
> > attributes, the syntax stays untouched.
>
> That's nice for computer usability and readability, but it does
> nothing for *human* usability and readability. Indeed, it makes those
> things worse.
I'm going to strongly disagree. I still remember the first time I saw
a function-like keyword in some source code, back when I was learning C.
I don't remember the exact keyword, but I remember it was a vendor
attribute in a function declaration. It was something like this:
void foo(int a) bar();
You can imagine me --a then inexpert C programer-- thinking "WTF is
this?!". What's the function? What are its parameters? Does it have
one parameter 'a'? Or no parameters? Is it called foo() or bar()?
With attributes syntax, it would have been
void foo(int a) [[bar()]];
Which anyone knowing that [[]] encloses attributes would recognize as
"this somehow modifies the declaration; look the documentation for the
precise attribute for the details".
>
> The attribute syntax was introduced with the understanding that they
> would be ignorable. They could have Godawful syntax because you
> weren't supposed to interact with them that much.
I don't think it's awful. I like _Upper and __lower just fine, and
don't think [[attr]] is much worse than that. You get used to the
spelling of things. FWIW, I use _Generic() often, and never felt the
need for a generic() macro wrapping that.
> That's why the
> `[[override]]` and `[[final]]` attributes became the `override` and
> `final` contextual keywords, and all of our lives were made better
> because of that.
>
> Attributes are supposed to be rarely used tools for very specific
> communication with compilers, not replacements for keywords because
> it's easier to standardize an attribute than an actual keyword.
And they should remain rarely used.
FWIW, I don't use _Alignas() often, and I think it would be much better
as an attribute [[::alignas()]]. I never remember where _Alignas()
goes in a declaration. But if it were an attribute, I'd only need to
remember the rules for attributes, which are relatively simple.
Have a lovely night!
Alex
>
> If C++ needs an easy way to introduce keywords, then add that.
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
-- <https://www.alejandro-colomar.es>
Received on 2026-02-10 00:17:20
