[VOTE] Shorter Attribute Syntax Change

php.internals

Derick Rethans

6 years ago
Hi, I've just opened the vote to make sure we don't make a terrible mistake with using the @@ syntax for attributes: https://wiki.php.net/rfc/shorter_attribute_syntax_change#voting The first vote is a vote to say that you have an opinion about attribute syntax. Make sure to read up on the discussion on the mailinglist if you haven't done so yet. The second vote is an STV vote. In STV you SHOULD rank *all* choices, but don't pick the same one more than once, as that will invalidate your vote. Please have a objective look at the table (https://wiki.php.net/rfc/shorter_attribute_syntax_change#proposal) and don't just go by asthetics. The vote ends August 23, 24:00 UTC. cheers, Derick
-- PHP 7.4 Release Manager Host of PHP Internals News: https://phpinternals.news Like Xdebug? Consider supporting me: https://xdebug.org/support https://derickrethans.nl | https://xdebug.org | https://dram.io twitter: @derickr and @xdebug

Rowan Collins

6 years ago
On Mon, 10 Aug 2020 at 09:41, Derick Rethans <derick@php.net> wrote:
> I've just opened the vote to make sure we don't make a terrible mistake > with using the @@ syntax for attributes: > > [...] > > Please have a objective look at the table > (https://wiki.php.net/rfc/shorter_attribute_syntax_change#proposal) and > don't just go by asthetics. >
Hi Derick, I am not a fan of the @@ syntax, and respect what you're trying to do with this RFC, but am disappointed you haven't engaged with those of us who said that the RFC needs more detail. There is simply not enough information in that table to "have an objective look", and the only other text in the RFC makes a vague assertion about the lack of ending symbol which I still don't understand the significance of. If I had a vote, I would vote "No" in the primary vote, not because I think the current syntax is perfect, but because I don't think this RFC makes a good case for a revote, and strongly suspect it will just be another beauty contest. Regards,
-- Rowan Tommins [IMSoP]

Peter Bowyer

6 years ago
On Mon, 10 Aug 2020 at 10:15, Rowan Tommins <rowan.collins@gmail.com> wrote:
> I am not a fan of the @@ syntax, and respect what you're trying to do with > this RFC, but am disappointed you haven't engaged with those of us who said > that the RFC needs more detail. There is simply not enough information in > that table to "have an objective look", and the only other text in the RFC > makes a vague assertion about the lack of ending symbol which I still don't > understand the significance of. >
I have voted no because I asked a question about the ending delimiter and why () didn't count. Another person asked a similar question and neither of us got a reply. Peter

Benjamin Eberlei

6 years ago
On Mon, Aug 10, 2020 at 11:28 AM Peter Bowyer <phpmailinglists@gmail.com> wrote:
> On Mon, 10 Aug 2020 at 10:15, Rowan Tommins <rowan.collins@gmail.com> > wrote: > > > I am not a fan of the @@ syntax, and respect what you're trying to do > with > > this RFC, but am disappointed you haven't engaged with those of us who > said > > that the RFC needs more detail. There is simply not enough information in > > that table to "have an objective look", and the only other text in the > RFC > > makes a vague assertion about the lack of ending symbol which I still > don't > > understand the significance of. > > > > I have voted no because I asked a question about the ending delimiter and > why () didn't count. Another person asked a similar question and neither of > us got a reply. >
() does not count as ending symbol, because it is not required, as such its not an ending symbol. The point Andreas Leathley makes in the discussion thread about new Foo not having an end symbol demonstrates exactly the opposite point he was trying to make, because the new statement itself has to end with a semicolon: new Foo(); new Foo; A statement has an ending symbol semicolon. Yes you can argue an attribute is metadata like "public" or "static" and they don't have start and ending symbols either. But they are also *single* words without special chars, as such much easier to distinguish. The difference is also apparent in another fact: Visibility keywords are just boolean flags on Reflection, Attributes have their own Reflection object, they represent much more. They shouldn't be mixed up with keywords. PHP is a language where most language constructs have ending delimiters. - Statements end in Semicolon - Function/Class/Method declarations end with a block closed by } - Argument lists end with ) - Docblocks end with */ - Comments always end with EOL (the distinction here being its a single end symbol, not ambiguous) As such for language consistency it would be better for Attributes to be enclosed by syntax, having a start **and* and ending symbol.

Andreas Leathley

6 years ago
On 10.08.20 15:08, Benjamin Eberlei wrote:
> () does not count as ending symbol, because it is not required, as > such its > not an ending symbol. > > The point Andreas Leathley makes in the discussion thread about new Foo not > having an end symbol demonstrates exactly the opposite point he was trying > to make, because the new statement itself has to end with a semicolon: > > new Foo(); > new Foo; > > A statement has an ending symbol semicolon.
While I don't know the exact internal semantics of PHP, according to my grasp of the language the new keyword does not need a semicolon at the end - it can be part of any expression, like "new Foo(new Bar);". According to the PHP manual (https://www.php.net/manual/en/language.basic-syntax.instruction-separation.php) instructions in PHP need to be terminated with a semicolon, while "new" as a keyword has no special requirement about a starting or ending delimiter. The point I was trying to make was that new and attributes have the same requirements in that they both need a class name and then optionally arguments for the constructor to that class, so they are both narrow in terms of what they do, attributes even more so than new, which reduces the helpfulness of delimiters as you cannot define arbitrary instructions in attributes - it always starts off with a class and then any possibly more complex instructions will be in the arguments, and those are enclosed by ().

Rowan Collins

6 years ago
On Mon, 10 Aug 2020 at 14:08, Benjamin Eberlei <kontakt@beberlei.de> wrote:
> > On Mon, Aug 10, 2020 at 11:28 AM Peter Bowyer <phpmailinglists@gmail.com> > wrote: > >> >> I have voted no because I asked a question about the ending delimiter and >> why () didn't count. Another person asked a similar question and neither >> of >> us got a reply. >> > > () does not count as ending symbol, because it is not required, as such > its not an ending symbol. >
The question asked was that _if the parentheses were made mandatory_, would this provide the same benefits ascribed to the other syntaxes? To avoid repeating myself, here are the previous posts where I elaborated on this question: * https://externals.io/message/111312#111342 * https://externals.io/message/111312#111354 Regards,
-- Rowan Tommins [IMSoP]

Guilherme Blanco

6 years ago
Hi, One question I'd like answered is that, like me, a few people have voted NO on the question to re-vote the syntax. If that is true, shouldn't their first primary choice be implied to be <<>> instead of anything else? I see 7 votes for no, but I'm the only one that still kept the first voting choice as <<>>. On Mon, Aug 10, 2020 at 9:40 AM Rowan Tommins <rowan.collins@gmail.com> wrote:
> > On Mon, 10 Aug 2020 at 14:08, Benjamin Eberlei <kontakt@beberlei.de> wrote: > > > > > On Mon, Aug 10, 2020 at 11:28 AM Peter Bowyer <phpmailinglists@gmail.com> > > wrote: > > > >> > >> I have voted no because I asked a question about the ending delimiter and > >> why () didn't count. Another person asked a similar question and neither > >> of > >> us got a reply. > >> > > > > () does not count as ending symbol, because it is not required, as such > > its not an ending symbol. > > > > > The question asked was that _if the parentheses were made mandatory_, would > this provide the same benefits ascribed to the other syntaxes? > > To avoid repeating myself, here are the previous posts where I elaborated > on this question: > > * https://externals.io/message/111312#111342 > * https://externals.io/message/111312#111354 > > > Regards, > -- > Rowan Tommins > [IMSoP]
-- Guilherme Blanco SVP Technology at Statflo Inc. Mobile: +1 647 232 5599

Benjamin Eberlei

6 years ago
On Mon, Aug 10, 2020 at 3:52 PM guilhermeblanco@gmail.com < guilhermeblanco@gmail.com> wrote:
> Hi, > > One question I'd like answered is that, like me, a few people have > voted NO on the question to re-vote the syntax. > If that is true, shouldn't their first primary choice be implied to be > <<>> instead of anything else? I see 7 votes for no, but I'm the only > one that still kept the first voting choice as <<>>. >
At this point voting NO on the primary vote means that you are either: 1. are not ok with revolting this late in the release cycle 2. want to keep @@, because this is the current syntax (not <<>>)

Benjamin Eberlei

6 years ago
On Mon, Aug 10, 2020 at 3:40 PM Rowan Tommins <rowan.collins@gmail.com> wrote:
> On Mon, 10 Aug 2020 at 14:08, Benjamin Eberlei <kontakt@beberlei.de> > wrote: > > > > > On Mon, Aug 10, 2020 at 11:28 AM Peter Bowyer <phpmailinglists@gmail.com > > > > wrote: > > > >> > >> I have voted no because I asked a question about the ending delimiter > and > >> why () didn't count. Another person asked a similar question and neither > >> of > >> us got a reply. > >> > > > > () does not count as ending symbol, because it is not required, as such > > its not an ending symbol. > > > > > The question asked was that _if the parentheses were made mandatory_, would > this provide the same benefits ascribed to the other syntaxes? > > To avoid repeating myself, here are the previous posts where I elaborated > on this question: > > * https://externals.io/message/111312#111342 > * https://externals.io/message/111312#111354
For me It would indeed make a slight difference, but not wanting to speak for Theodore, I believe he did not want to add this as another option to vote upon, when I asked him. based on the argument that new also doesn't require () it makes sense to me. And for me I didn't want to add it, because then we can just go back to <<>>, which would at least be symmetrical. I.e. @@Jit() vs <<Jit>>

Rowan Collins

6 years ago
On Mon, 10 Aug 2020 at 14:56, Benjamin Eberlei <kontakt@beberlei.de> wrote:
> > On Mon, Aug 10, 2020 at 3:40 PM Rowan Tommins <rowan.collins@gmail.com> > wrote: > >> The question asked was that _if the parentheses were made mandatory_, >> would >> this provide the same benefits ascribed to the other syntaxes? >> > > For me It would indeed make a slight difference... >
Sorry, I'm as confused by this answer as I was by Derick's. Is that a "yes, it would solve the same problems", or "it would solve some problems but not others"? Regards,
-- Rowan Tommins [IMSoP]

Derick Rethans

6 years ago
On Mon, 10 Aug 2020, Peter Bowyer wrote:
> On Mon, 10 Aug 2020 at 10:15, Rowan Tommins <rowan.collins@gmail.com> wrote: > > > I am not a fan of the @@ syntax, and respect what you're trying to do with > > this RFC, but am disappointed you haven't engaged with those of us who said > > that the RFC needs more detail. There is simply not enough information in > > that table to "have an objective look", and the only other text in the RFC > > makes a vague assertion about the lack of ending symbol which I still don't > > understand the significance of. > > > > I have voted no because I asked a question about the ending delimiter and > why () didn't count. Another person asked a similar question and neither of > us got a reply.
I did answer that as a reply to Rowan: https://externals.io/message/111312#111346 cheers, Derick
-- PHP 7.4 Release Manager Host of PHP Internals News: https://phpinternals.news Like Xdebug? Consider supporting me: https://xdebug.org/support https://derickrethans.nl | https://xdebug.org | https://dram.io twitter: @derickr and @xdebug

Peter Bowyer

6 years ago
On Mon, 10 Aug 2020 at 14:59, Derick Rethans <derick@php.net> wrote:
> I did answer that as a reply to Rowan: > > https://externals.io/message/111312#111346
I'm with Rowan's response to you: https://externals.io/message/111312#111354 What is the difference between mandatory parentheses giving: <<symbol>><<attribute-name>>( <<symbol>><<attribute-name2>>(<<arg1>>), 42 ) and: <<symbol>>[<<attribute-name>>( <<symbol>>[<<attribute-name2>>(<<arg1>>)], 42 )] in terms of parsing, use etc. Peter

Peter Bowyer

6 years ago
On Mon, 10 Aug 2020 at 15:41, Peter Bowyer <phpmailinglists@gmail.com> wrote:
> > > On Mon, 10 Aug 2020 at 14:59, Derick Rethans <derick@php.net> wrote: > >> I did answer that as a reply to Rowan: >> >> https://externals.io/message/111312#111346 > > > I'm with Rowan's response to you: > https://externals.io/message/111312#111354 > > What is the difference between mandatory parentheses giving: > > <<symbol>><<attribute-name>>( > <<symbol>><<attribute-name2>>(<<arg1>>), > 42 > ) > > and: > > <<symbol>>[<<attribute-name>>( > <<symbol>>[<<attribute-name2>>(<<arg1>>)], > 42 > )] > > in terms of parsing, use etc? > > Peter >
Anyone? Why is the discussion fixated on [] rather than ()? Peter

Rowan Collins

6 years ago
On Tue, 11 Aug 2020 at 14:15, Peter Bowyer <phpmailinglists@gmail.com> wrote:
> Anyone? > > Why is the discussion fixated on [] rather than ()? >
Elsewhere, Derick clarified that he sees a "conceptual/logical" difference between brackets around just the argument list and the brackets around the whole expression, rather than anything concrete to do with parsing. I suspect this is a mental bias because we're used to pairing off ( and ) or [ and ]. If we imagine a straw man syntax with no brackets of any sort: ~~AttributeName:param1,param2! I think everyone would agree that the "!" here ended the attribute declaration, not just the parameter list. But looking closely, that's a one-to-one substitution from @@ with mandatory parens: ~~ <name> : <argument-list> ! @@ <name> ( <argument-list> ) That doesn't mean it's wrong to say there's a different feeling between the two, but does highlight that like every other factor discussed, this is basically a subjective feeling, rather than anything substantial. Regards,
-- Rowan Tommins [IMSoP]

Benjamin Eberlei

6 years ago
On Mon, Aug 10, 2020 at 11:16 AM Rowan Tommins <rowan.collins@gmail.com> wrote:
> On Mon, 10 Aug 2020 at 09:41, Derick Rethans <derick@php.net> wrote: > > > I've just opened the vote to make sure we don't make a terrible mistake > > with using the @@ syntax for attributes: > > > > [...] > > > > Please have a objective look at the table > > (https://wiki.php.net/rfc/shorter_attribute_syntax_change#proposal) and > > don't just go by asthetics. > > > > > Hi Derick, > > I am not a fan of the @@ syntax, and respect what you're trying to do with > this RFC, but am disappointed you haven't engaged with those of us who said > that the RFC needs more detail. There is simply not enough information in > that table to "have an objective look", and the only other text in the RFC > makes a vague assertion about the lack of ending symbol which I still don't > understand the significance of. > > If I had a vote, I would vote "No" in the primary vote, not because I think > the current syntax is perfect, but because I don't think this RFC makes a > good case for a revote, and strongly suspect it will just be another beauty > contest. >
I am sorry this was a misunderstanding between Derick and I. I had worked on the more detail already, but we had a miscommunication about updating the RFC. I add my notes in a few minutes, sorry :-(

Jordi Boggiano

6 years ago
On 10/08/2020 10:41, Derick Rethans wrote:
> I've just opened the vote to make sure we don't make a terrible mistake > with using the @@ syntax for attributes: > > https://wiki.php.net/rfc/shorter_attribute_syntax_change#voting >
Here is a more detailed comparison of how this would look like in real use, adapted from some basic doctrine and symfony validation annotation I got somewhere: https://gist.github.com/Seldaek/b7a3bd28920c6cc181e67a829b13a81c I think something like this would belong in the RFC. I find that the grouping "feature" does not help that much, it's kinda hard to grasp what's going on. Proper syntax highlighting would surely help but still. You may argue it's comparing in terms of looks, but as others have said I find it hard to compare them in other terms as the pros/cons listed in the RFC have a very limited impact for the most part, so yeah I feel like looks and readability should be at least somewhat taken into account too. Best, Jordi

Markus Fischer

6 years ago
On 10.08.20 13:32, Jordi Boggiano wrote:
> https://gist.github.com/Seldaek/b7a3bd28920c6cc181e67a829b13a81c
This is really really useful! However I suggest to look at the raw text rather, because the highlighting is unaware of the syntax and may bias "how it feels to look at it" (*): https://gist.githubusercontent.com/Seldaek/b7a3bd28920c6cc181e67a829b13a81c/raw/ccb612d2547c99fe69d1bf09138efae22b956b37/attributes.php Personally, and never gave it much thought TBH, the `@@` AND `<<`/`>>` in fact is the most "unreadable" version to me because duplicate occurrence of a single character somehow creates a noise _for me_, I don't feel eligible to have a vote, but based on that and certainly aware IDEs in the future will help with this, I would vote for _anything_ not duplicating characters, i.e. favoring `#[]` or `@[]` :-} - Markus (*) Apologies for lack of words trying to describe my thoughts

Andreas Leathley

6 years ago
On 10.08.20 15:05, Markus Fischer wrote:
> Personally, and never gave it much thought TBH, the `@@` AND `<<`/`>>` > in fact is the most "unreadable" version to me because duplicate > occurrence of a single character somehow creates a noise _for me_, > > I don't feel eligible to have a vote, but based on that and certainly > aware IDEs in the future will help with this, I would vote for > _anything_ not duplicating characters, i.e. favoring `#[]` or `@[]`
It is a pity that syntax with ending delimiters and syntax with no ending delimiters are now mixed in the discussion, instead of first finding a concensus if delimiters are even needed or what advantages/disadvantages they have. Because there are many alternatives in terms of syntax - looking back at the very first vote about attributes the @: syntax doesn't seem so bad, if no ending delimiters are needed. In the new RFC all alternatives to @@ have delimiters and it is suggested having them is good, yet the possible advantages of delimiters are never explained, ideally with some real-world examples showing why delimiters would be good to have.

Derick Rethans

6 years ago
On Mon, 10 Aug 2020, Andreas Leathley wrote:
> On 10.08.20 15:05, Markus Fischer wrote: > > Personally, and never gave it much thought TBH, the `@@` AND `<<`/`>>` > > in fact is the most "unreadable" version to me because duplicate > > occurrence of a single character somehow creates a noise _for me_, > > > > I don't feel eligible to have a vote, but based on that and certainly > > aware IDEs in the future will help with this, I would vote for > > _anything_ not duplicating characters, i.e. favoring `#[]` or `@[]` > > It is a pity that syntax with ending delimiters and syntax with no > ending delimiters are now mixed in the discussion, instead of first > finding a concensus if delimiters are even needed or what > advantages/disadvantages they have.
It missing an ending delimiter was my first reason for wanting to get something better than @@. I don't particularly care much if it ends up being @[], #[], <<>>, or other things such as @:( ). In my original email, I solicited other syntaxes (with patches), but none were brought up.
> Because there are many alternatives in terms of syntax - looking back > at the very first vote about attributes the @: syntax doesn't seem so > bad, if no ending delimiters are needed. In the new RFC all > alternatives to @@ have delimiters and it is suggested having them is > good, yet the possible advantages of delimiters are never explained, > ideally with some real-world examples showing why delimiters would be > good to have.
If you have something to open, and close, there there is a distinct area that forms the whole definition of a thing. That's why functions, and classes have { and }, if and other control structures have ( .. ), etc. Being able to define a whole "thing" easily with an open and closing set of symbols, allows for better mental parsing. It also means that syntax highlighting tools can map the opening part with the closing part. (VIM for example, uses the % character to jump between opening and closing symbol). cheers, Derick
-- PHP 7.4 Release Manager Host of PHP Internals News: https://phpinternals.news Like Xdebug? Consider supporting me: https://xdebug.org/support https://derickrethans.nl | https://xdebug.org | https://dram.io twitter: @derickr and @xdebug

Andreas Leathley

6 years ago
On 10.08.20 17:40, Derick Rethans wrote:
> It missing an ending delimiter was my first reason for wanting to get > something better than @@. I don't particularly care much if it ends up > being @[], #[], <<>>, or other things such as @:( ). > > If you have something to open, and close, there there is a distinct area > that forms the whole definition of a thing. That's why functions, and > classes have { and }, if and other control structures have ( .. ), etc. > > Being able to define a whole "thing" easily with an open and closing set > of symbols, allows for better mental parsing. It also means that syntax > highlighting tools can map the opening part with the closing part. (VIM > for example, uses the % character to jump between opening and closing > symbol).
For me the difference would be that with attributes, you are not opening and closing many possible statements, it can only be one (or more, with grouping) class name(s), which then can have arguments, but those are enclosed with (). In comparison, classes can have many possible definitions inside of them (class variables, methods, constants, etc.), so enclosing them clearly makes sense, as you need to know where it ends. The same goes for if, for, while, etc. So if you just have one class name as an attribute, enclosing it seems a bit overkill, as there is already a definition of a class name and how it starts and ends, which is why for me the mental parsing does not seem easier - but what is easily parseable probably depends on many factors and might be different for different people. I would have found a syntax where the delimiters are optional preferable - similar to "if", where you can leave off the {} for exactly one instruction, but you have to add them if there is more than one line of instructions. Or the group use syntax.

Theodore Brown

6 years ago
On Mon, Aug 10, 2020 at 3:41 AM Derick Rethans <derick@php.net> wrote: > I've just opened the vote to make sure we don't make a terrible mistake > with using the @@ syntax for attributes: > > https://wiki.php.net/rfc/shorter_attribute_syntax_change#voting > > The first vote is a vote to say that you have an opinion about attribute > syntax. Make sure to read up on the discussion on the mailinglist if you > haven't done so yet. I voted "No", as the primary premise for this RFC is fundamentally flawed: > The main concern is that @@ has no ending symbol and it's inconsistent > with the language that it would be the only declaration or statement > in the whole language that has no ending termination symbol. As I pointed out in the discussion thread, this simply is not the case. Attributes are not standalone declarations or statements, but modifiers that always come before a declaration and add metadata to it. This is consistent with visibility modifiers and type declarations (which are not necessarily a single word): # declaration modifiers do not have end/grouping symbols like this @[MyAttr([1, 2])] [public] function foo(@[Deprecated] [int|float] $bar) {} # this is more consistent: @@MyAttr([1, 2]) public function foo(@@Deprecated int|float $bar) {} > The second vote is an STV vote. > > In STV you SHOULD rank *all* choices, but don't pick the same one more > than once, as that will invalidate your vote. > > Please have a objective look at the table > (https://wiki.php.net/rfc/shorter_attribute_syntax_change#proposal) and > don't just go by asthetics. I find this table to be unfortunately incomplete. E.g. why doesn't it bold the number of required characters for @@, since this is one of its advantages? And why is "Allows Grouping" marked as an advantage for the other three syntaxes? Grouping adds implementation complexity, leads to unnecessary diff noise, and is rarely more concise than @@ in real-world use cases. I also find it concerning that the RFC doesn't have an example for each consideration showing how one syntax addresses it better than another. For example, the Shorter Attribute Syntax RFC showed potential nested attributes and how @@ would support them more cleanly, but this RFC fails to mention them anywhere. Finally, while the table mentions that each syntax other than <<>> has a BC break, I think it's just as important to consider the *size* of the breaking change. #[] and @[] are larger BC breaks than @@ since they break useful syntax: // with #[] #[x] code like this would break $val = ['new value']; #['old value']; // with @[] $x = @[foo(), bar()]; // this code would break Both of these are useful patterns, and I'm not convinced that breaking them is justified. Shouldn't there be a Backward Incompatible Changes section in the RFC with these examples? Best regards, Theodore

Benas IML

6 years ago
On Mon, Aug 10, 2020, 4:28 PM Theodore Brown <theodorejb@outlook.com> wrote:
> On Mon, Aug 10, 2020 at 3:41 AM Derick Rethans <derick@php.net> wrote: > > > I've just opened the vote to make sure we don't make a terrible mistake > > with using the @@ syntax for attributes: > > > > https://wiki.php.net/rfc/shorter_attribute_syntax_change#voting > > > > The first vote is a vote to say that you have an opinion about attribute > > syntax. Make sure to read up on the discussion on the mailinglist if you > > haven't done so yet. > > I voted "No", as the primary premise for this RFC is fundamentally flawed: > > > The main concern is that @@ has no ending symbol and it's inconsistent > > with the language that it would be the only declaration or statement > > in the whole language that has no ending termination symbol. > > As I pointed out in the discussion thread, this simply is not the case. > Attributes are not standalone declarations or statements, but modifiers > that always come before a declaration and add metadata to it. This > is consistent with visibility modifiers and type declarations (which > are not necessarily a single word): > > # declaration modifiers do not have end/grouping symbols like this > @[MyAttr([1, 2])] > [public] function foo(@[Deprecated] [int|float] $bar) {} > > # this is more consistent: > > @@MyAttr([1, 2]) > public function foo(@@Deprecated int|float $bar) {} > > > The second vote is an STV vote. > > > > In STV you SHOULD rank *all* choices, but don't pick the same one more > > than once, as that will invalidate your vote. > > > > Please have a objective look at the table > > (https://wiki.php.net/rfc/shorter_attribute_syntax_change#proposal) and > > don't just go by asthetics. > > I find this table to be unfortunately incomplete. E.g. why doesn't it > bold the number of required characters for @@, since this is one of > its advantages? And
IMO there's literally no advantage in typing one less character. Because if there is, let's also shorten all of our function names i. e. `strlen` to `sl` and `gettype` to `gt`. why is "Allows Grouping" marked as an advantage
> for the other three syntaxes? Grouping adds implementation complexity, > leads to unnecessary diff noise, and is rarely more concise than @@ in > real-world use cases. >
I'd like to remind other internals that there is no "added complexity" (unless someone is unable to understand 20 lines of code) and it's misleading to say otherwise.
> I also find it concerning that the RFC doesn't have an example for each > consideration showing how one syntax addresses it better than another. > For example, the Shorter Attribute Syntax RFC showed potential nested > attributes and how @@ would support them more cleanly, but this RFC > fails to mention them anywhere.
Syntax choice DOES NOT affect how "cleanly" we can support nested attributes. AFAIK simple recursion would allow to implement those with any attribute syntax with exactly the same code.

Chris Riley

6 years ago
Hi, Quick question. What is the expected behaviour of: @[Bar()]; class Foo {} That would appear to be valid code and for the difference of a single ; does wildly different things, assuming there is a function Bar defined somewhere. (and only by the fact that @ doesn't suppress fatal errors does it not cause utter confusion if Bar isn't defined) Regards, Chris On Mon, 10 Aug 2020 at 09:41, Derick Rethans <derick@php.net> wrote:

Matteo Beccati

6 years ago
Hi, On 11/08/2020 12:10, Chris Riley wrote:
> What is the expected behaviour of: > > @[Bar()]; > class Foo {} > > That would appear to be valid code and for the difference of a single ; > does wildly different things, assuming there is a function Bar defined > somewhere. (and only by the fact that @ doesn't suppress fatal errors does > it not cause utter confusion if Bar isn't defined)
I think an 'unexpected token ";"', which is what currently happens if you do the same with "@@" on current master, would still be an appropriate behaviour. FWIW, I haven't made up my mind yet and that's why I haven't cast my vote yet. I do agree with Chris here and I somehow mentally parse the above as "silencing an array containing a function call", which to me is bad enough to rule the syntax out. I would surely get used to it, if accepted, but that's how I feel now. Rust's #[] to me looks better, but I am still bothered by the fact that it can be used in a backwards compatible way, but not fully so (multi-line, syntax errors). And "@@" is super ugly, although I'm not bothered that much by its lack of ending delimiter, since most of the times longer attributes will still, albeit just visually, have some in the closing ")". Cheers
-- Matteo Beccati Development & Consulting - http://www.beccati.com/

Chris Riley

6 years ago
On Tue, 11 Aug 2020 at 12:40, Matteo Beccati <php@beccati.com> wrote:
> Hi, > > On 11/08/2020 12:10, Chris Riley wrote: > > What is the expected behaviour of: > > > > @[Bar()]; > > class Foo {} > > > > That would appear to be valid code and for the difference of a single ; > > does wildly different things, assuming there is a function Bar defined > > somewhere. (and only by the fact that @ doesn't suppress fatal errors > does > > it not cause utter confusion if Bar isn't defined) > I think an 'unexpected token ";"', which is what currently happens if > you do the same with "@@" on current master, would still be an > appropriate behaviour. > > FWIW, I haven't made up my mind yet and that's why I haven't cast my > vote yet. > > I do agree with Chris here and I somehow mentally parse the above as > "silencing an array containing a function call", which to me is bad > enough to rule the syntax out. I would surely get used to it, if > accepted, but that's how I feel now. > > Rust's #[] to me looks better, but I am still bothered by the fact that > it can be used in a backwards compatible way, but not fully so > (multi-line, syntax errors). > > And "@@" is super ugly, although I'm not bothered that much by its lack > of ending delimiter, since most of the times longer attributes will > still, albeit just visually, have some in the closing ")". > > > Cheers > -- > Matteo Beccati > > Development & Consulting - http://www.beccati.com/
My concern wasn't so much of mentally parsing it as a silenced function call in an array; more that PHP currently parses it that way. That example becoming invalid code would be a reasonable option, but leaving it as valid code just sets people up to spend ages hunting a "why is this annotation not being applied to my class bug". (and before anyone says this won't happen; I have spent hours in the past tracking down missing annotations which occured because of the difference between /* and /**) For the record, my preference is @[ ], I just also like removing as many potential cases of debugging stupid issues as possible. ~C

Derick Rethans

6 years ago
On Tue, 11 Aug 2020, Chris Riley wrote:
> Quick question. > > What is the expected behaviour of: > > @[Bar()]; > class Foo {}
That will error out in PHP 8, with: Parse error: syntax error, unexpected token ";" in Standard input code on line 2 cheers, Derick
-- PHP 7.4 Release Manager Host of PHP Internals News: https://phpinternals.news Like Xdebug? Consider supporting me: https://xdebug.org/support https://derickrethans.nl | https://xdebug.org | https://dram.io twitter: @derickr and @xdebug

Chris Riley

6 years ago
On Tue, 11 Aug 2020 at 13:21, Derick Rethans <derick@php.net> wrote:
> On Tue, 11 Aug 2020, Chris Riley wrote: > > > Quick question. > > > > What is the expected behaviour of: > > > > @[Bar()]; > > class Foo {} > > That will error out in PHP 8, with: > > Parse error: syntax error, unexpected token ";" in Standard input code on > line 2 > > cheers, > Derick > > -- > PHP 7.4 Release Manager > Host of PHP Internals News: https://phpinternals.news > Like Xdebug? Consider supporting me: https://xdebug.org/support > https://derickrethans.nl | https://xdebug.org | https://dram.io > twitter: @derickr and @xdebug >
Is <?php @[Bar()]; ?> on it's own an error?

Theodore Brown

6 years ago
On Tue, Aug 11, 2020 at 7:26 AM Chris Riley <t.carnage@gmail.com> wrote: > On Tue, 11 Aug 2020 at 13:21, Derick Rethans <derick@php.net> wrote: > > > On Tue, 11 Aug 2020, Chris Riley wrote: > > > > > Quick question. > > > > > > What is the expected behaviour of: > > > > > > @[Bar()]; > > > class Foo {} > > > > That will error out in PHP 8, with: > > > > Parse error: syntax error, unexpected token ";" in Standard input code on > > line 2 > > Is > > <?php @[Bar()]; ?> > > on it's own an error? Yes. Basically this is an example of valid code in PHP 7 that will break if @[] is adopted. However, it will remain valid to write the following: @ [Bar()]; // suppressed function call @[ Bar() ] // attribute class Foo {} Is this still confusing? I think so. People could easily expect that the first line is an attribute, or that attributes *should* be followed by a semicolon since they have an ending bracket. **This could even make it easier to sneak vulnerabilities into PHP projects.** :\ A second downside of @[] that doesn't appear to have been discussed yet is typability. On my keyboard, it requires four different keys on different sides of the keyboard, whereas @@ just requires two keys. Thirdly, the @[] syntax with grouping removes the ability to easily grep for attributes, which was one of the benefits of @@ mentioned in the Shorter Attribute Syntax RFC. Unfortunately, this new RFC fails to mention any of these issues, thus presenting an incomplete picture of the pros and cons which appears to be influencing the vote results against @@. @[] has had relatively little discussion compared to the other syntax options so far, and not all of its issues may even be known yet. Best regards, Theodore

Lynn

6 years ago
On Tue, Aug 11, 2020 at 3:03 PM Theodore Brown <theodorejb@outlook.com> wrote:
> A second downside of @[] that doesn't appear to have been discussed > yet is typability. On my keyboard, it requires four different keys > on different sides of the keyboard, whereas @@ just requires two keys. >
If typability really matters, we should've deprecated the backtick version to run things. We also seem to forget about readability. @@ makes things really hard to read for me as it draws attention, the same goes for <<and>> being written as such, with spaces it's fine. In terms of @[] typability, my IDE auto completes the ] when I type [. After that we have to type a word which will most likely require keys on the right side of the keyboard anyway. Sure, typing @@ is easier, for me this is at the cost of readability. I read code more frequently than I write it, so I think this should matter more. Please don't use @@ for annotations/attributes.

Rowan Collins

6 years ago
On Tue, 11 Aug 2020 at 14:16, Lynn <kjarli@gmail.com> wrote:
> In terms of @[] typability, my IDE auto completes the ] when I type [. >
I really, really, hate when editors and IDEs do that, and switch off every variant of it I can find in the settings. Either it will get it wrong because I'm editing code not writing from scratch; or it will get it right but I'll type the punctuation myself before I notice that; in both cases, it takes _more_ effort to type with that feature than without it. As far as the UK keyboard layout's concerned, all four of the options in this week's list use buttons to the right of the letters, although #[] is the only one that doesn't need any use of shift. Which mostly just goes to show that pretty much any punctuation will be hard to type on some layouts and easy on others. Regards,
-- Rowan Tommins [IMSoP]

Andreas Leathley

6 years ago
On 11.08.20 15:15, Lynn wrote:
> If typability really matters, we should've deprecated the backtick > version > to run things. We also seem to forget about readability. @@ makes things > really hard to read for me as it draws attention, the same goes for <<and>> > being written as such, with spaces it's fine. In terms of @[] typability, > my IDE auto completes the ] when I type [. After that we have to type a > word which will most likely require keys on the right side of the keyboard > anyway. Sure, typing @@ is easier, for me this is at the cost of > readability. I read code more frequently than I write it, so I think this > should matter more. > > Please don't use @@ for annotations/attributes.
I do understand that not everyone likes @@ in terms of perceived readability, although in IDEs this will probably be less of a problem (by making @@ less noticeable in terms of colors and contrast). It seems unfortunate to me that this RFC just seems super hasty in terms of unfinished discussions and in that it mixes very different concerns - an ending delimiter is made out to be necessary in terms of language, although that seems contentious at best and would be something to agree on first, separate of the actual syntax and how it looks and feels. And if someone does not like @@ yet would like a different syntax with no delimiters, there is no choice for that. The @[] syntax is very last minute, and including the original choice of @: would have also been an option: at the time it lost against <<>>, but after that <<>> lost against @@, so the choices in the RFC are obviously chosen to make sure a syntax with delimiters is chosen, yet sacrificing a proper discussion (and enable people to think about it more) because of the time constraints - instead of just delaying it for 8.1 and having the necessary time to get to the best possible solution. Just compare the previous RFCs about the attribute feature and syntax and the current one - the current one does not even explain the BC breaks the different syntaxes produce, which was otherwise always one of the more important parts of an RFC, so at best the RFC is incomplete in terms of its information. As far as I can tell almost none of the suggestions to amend the RFCs have been taken into account, so the original discussion about it seems to have been pointless. I am a bit disappointed to see this kind of process in PHP, especially "last-minute" before a new major release.

Derick Rethans

6 years ago
On Tue, 11 Aug 2020, Theodore Brown wrote:
> A second downside of @[] that doesn't appear to have been discussed > yet is typability. On my keyboard, it requires four different keys on > different sides of the keyboard, whereas @@ just requires two keys.
They're the same on a US English/US International keyboard, both 4 presses: For @@: Shift 2 Shift 2 For @[]: Shift 2 [ ] In the case of @[], an IDE likely will automatically add the closing ]. Additionally, on a US English/US International keybaord, Shift-2 (for @) is an awkward combination to type with the pinky and middle finger of your left hand. On a UK English, it's the same amount, with the @ a little easier than on a US English one, with: left-shift @/' [ ] So if you want to add typeability to the matrix, I can do that, but @@ comes out worse. cheers, Derick
-- PHP 7.4 Release Manager Host of PHP Internals News: https://phpinternals.news Like Xdebug? Consider supporting me: https://xdebug.org/support https://derickrethans.nl | https://xdebug.org | https://dram.io twitter: @derickr and @xdebug

Theodore Brown

6 years ago
On Tue, Aug 11, 2020 at 8:37 AM Derick Rethans <derick@php.net> wrote: > On Tue, 11 Aug 2020, Theodore Brown wrote: > > > A second downside of @[] that doesn't appear to have been discussed > > yet is typability. On my keyboard, it requires four different keys on > > different sides of the keyboard, whereas @@ just requires two keys. > > They're the same on a US English/US International keyboard, both 4 > presses: > > For @@: Shift 2 Shift 2 > For @[]: Shift 2 [ ] > > In the case of @[], an IDE likely will automatically add the > closing ]. > > Additionally, on a US English/US International keybaord, Shift-2 (for @) > is an awkward combination to type with the pinky and middle finger of > your left hand. > > On a UK English, it's the same amount, with the @ a little easier than > on a US English one, with: left-shift @/' [ ] > > So if you want to add typeability to the matrix, I can do that, but @@ > comes out worse. How does @@ come out worse? For @@: Shift, double-@ For @[]: Shift, @, left bracket Even if your IDE autocompletes the closing bracket, @@ is faster to type than @[] on common qwerty layouts. Also, it is easier to mistype @[ as @] (I kept doing this multiple times when typing this reply). Anyway, please do add easy typeability to the matrix, along with the fact that the @@ syntax makes attributes easier to grep for. These should have been in the matrix from the start, given that both were mentioned as factors in the Shorter Attribute Syntax RFC. When I originally wrote the Shorter Attribute Syntax RFC, I wasn't aware that it was allowed to re-vote on failed syntax options without waiting at least 6 months. Otherwise I would have included an option to re-vote for the @: syntax. Since apparently this is allowed now, can we also add @: as a voting option? I have a patch for it here: https://github.com/theodorejb/php-src/pull/1 It seems pretty clear that the vote should be restarted anyway, given that the RFC has already been heavily edited multiple times after the voting started. Kind regards, Theodore

Rowan Collins

6 years ago
On Tue, 11 Aug 2020 at 16:31, Theodore Brown <theodorejb@outlook.com> wrote:
> > How does @@ come out worse?
Seems clear enough to me:
> Additionally, on a US English/US International keybaord, Shift-2 (for @) > is an awkward combination to type with the pinky and middle finger of > your left hand.
(Note that this is also true of UK Mac keyboards, which more closely resemble the US PC layout.)
> Anyway, please do add easy typeability to the matrix >
How would you measure "easy typability"? On what keyboard layout? Would you write "Yes" and "No", or "quite easy", or marks out of 10?
> fact that the @@ syntax makes attributes easier to grep for. >
The same question: how do you summarise this in a table? Complexity of the regex? Number of false positives in some representative code base? As I've said before, the table would be useful if it was a re-cap of arguments discussed in prose elsewhere, but it is not on its own a good source of information for making a decision. Regards,
-- Rowan Tommins [IMSoP]

Theodore Brown

6 years ago
On Tue, Aug 11, 2020 at 10:39 AM Rowan Tommins <rowan.collins@gmail.com> wrote: > On Tue, 11 Aug 2020 at 16:31, Theodore Brown <theodorejb@outlook.com> wrote: > > > Anyway, please do add easy typeability to the matrix > > How would you measure "easy typability"? On what keyboard layout? > Would you write "Yes" and "No", or "quite easy", or marks out of 10? Hi Rowan, I would suggest "Kinds of symbols used". @@ is easier since it only uses one kind of symbol, rather than switching between two or three symbols which are often on different sides of the keyboard. > > fact that the @@ syntax makes attributes easier to grep for. > > The same question: how do you summarise this in a table? Complexity > of the regex? Number of false positives in some representative code > base? This can be a simple Yes or No. With @@ or @: you can type those symbols followed by the attribute name to grep for it. With the other syntaxes and attribute grouping, if the name isn't unique it may be difficult to search for since you can't rely on a unique leading symbol. > As I've said before, the table would be useful if it was a re-cap of > arguments discussed in prose elsewhere, but it is not on its own a good > source of information for making a decision. Generally I agree, the table is not particularly helpful in making a decision here. Regards, Theodore

Rowan Collins

6 years ago
On Tue, 11 Aug 2020 at 17:07, Theodore Brown <theodorejb@outlook.com> wrote:
> > I would suggest "Kinds of symbols used". > > @@ is easier since it only uses one kind of symbol, rather than > switching between two or three symbols which are often on different > sides of the keyboard. >
Honestly, this feels about as objective as "number of pixels" - feel free to use it your own vote, but it doesn't feel headline-worthy.
> > > fact that the @@ syntax makes attributes easier to grep for. > > This can be a simple Yes or No. With @@ or @: you can type those > symbols followed by the attribute name to grep for it. With the other > syntaxes and attribute grouping, if the name isn't unique it may be > difficult to search for since you can't rely on a unique leading symbol. >
Surely *all* of the syntaxes will be easily greppable once adopted, because any instances that aren't attributes will have to be fixed (other than those in comments and strings, which can happen with any of them). Any of these will show up very little outside attributes once you've fixed parse errors: #[ @[ @: @@ "<<" is possibly an outlier here IF you use bit shifts a lot. To filter further, you can write a quick regex to match the attribute name; untested, but something like: /#\[[A-Za-z0-9\\]+[\(\]]/ /@\[[A-Za-z0-9\\]+[\(\]]/ /@:[A-Za-z0-9\\]+/ /@@[A-Za-z0-9\\]+/ /<<[A-Za-z0-9\\]+(>>|\()/ That last one has a small chance of matching something like "$foo = $bar<<getShiftSize();" which might be annoying if you use bitshifts a lot AND don't put spaces around operators. So, sure, <<Foo>> has a small disadvantage here, but it's also been thoroughly rejected in a previous vote, and seems unlikely to suddenly make a comeback. Regards,
-- Rowan Tommins [IMSoP]

Jakob Givoni

6 years ago
On Tue, Aug 11, 2020 at 3:03 PM Theodore Brown <theodorejb@outlook.com> wrote:
> > On Tue, Aug 11, 2020 at 7:26 AM Chris Riley <t.carnage@gmail.com> wrote: > > > On Tue, 11 Aug 2020 at 13:21, Derick Rethans <derick@php.net> wrote: > > > > > On Tue, 11 Aug 2020, Chris Riley wrote: > > > > > > > Quick question. > > > > > > > > What is the expected behaviour of: > > > > > > > > @[Bar()]; > > > > class Foo {} > > > > > > That will error out in PHP 8, with: > > > > > > Parse error: syntax error, unexpected token ";" in Standard input code on > > > line 2 > > > > Is > > > > <?php @[Bar()]; ?> > > > > on it's own an error? > > Yes. Basically this is an example of valid code in PHP 7 that will > break if @[] is adopted.
Wow, that was unexpected. By what logic? Also, how long must I wait before I can put a semicolon after the new attribute syntax? Is one whitespace enough or do I have to go to a new line? To me, suddenly disallowing semicolons at some points between statements or between a "declaration" and a statement seems to break PHP logic. Are there any precedents for this that I've missed? Best, Jakob

Rowan Collins

6 years ago
On 12 August 2020 19:03:02 BST, Jakob Givoni <jakob@givoni.dk> wrote:
>> > Is >> > >> > <?php @[Bar()]; ?> >> > >> > on it's own an error? >> >> Yes. Basically this is an example of valid code in PHP 7 that will >> break if @[] is adopted. > >Wow, that was unexpected. By what logic? >Also, how long must I wait before I can put a semicolon after the new >attribute syntax? Is one whitespace enough or do I have to go to a new >line? >To me, suddenly disallowing semicolons at some points between >statements or between a "declaration" and a statement seems to break >PHP logic.
It's not that the semicolon is forbidden as such, it's that the code is interpreted completely differently. Imagine if we had no "private" keyword, and then added it; this would previously have been valid (a statement followed by a declaration): private; function foo () {} But once "private" is a keyword, that is a syntax error. Removing the semicolon happens to make a valid declaration using the keyword, but that's basically coincidence: private function foo() {} The same is true of attributes, which as others have pointed out are similar to visibility or scope modifiers - anywhere that could be an attribute will be parsed as one, not as a statement, comment, or whatever else, so some code changes meaning, and other code becomes a syntax error. Regards,
-- Rowan Tommins [IMSoP]

Jakob Givoni

6 years ago
On Wed, Aug 12, 2020 at 9:08 PM Rowan Tommins <rowan.collins@gmail.com> wrote:
> > On 12 August 2020 19:03:02 BST, Jakob Givoni <jakob@givoni.dk> wrote: > >> > Is > >> > > >> > <?php @[Bar()]; ?> > >> > > >> > on it's own an error? > >> > >> Yes. Basically this is an example of valid code in PHP 7 that will > >> break if @[] is adopted. > > > >Wow, that was unexpected. By what logic? > >Also, how long must I wait before I can put a semicolon after the new > >attribute syntax? Is one whitespace enough or do I have to go to a new > >line? > >To me, suddenly disallowing semicolons at some points between > >statements or between a "declaration" and a statement seems to break > >PHP logic. > > > It's not that the semicolon is forbidden as such, it's that the code is interpreted completely differently. > > Imagine if we had no "private" keyword, and then added it; this would previously have been valid (a statement followed by a declaration): > > private; function foo () {}
Ok, that's starting to make sense. Having seen so many attribute examples lately I started to get the impression that you could basically insert them anywhere (like comments) - even if it didn't technically make any sense... Reading the original RFC again I understand that an attribute MUST be directly followed by a function, class, interface, traits, class constant, class property, class method, function/method parameter, a docblock or another attribute. I hope I didn't forget anything... Sorry, I'm just a sucker for details and accuracy :-) Thanks, Jakob

Sara Golemon

6 years ago
On Mon, Aug 10, 2020 at 3:41 AM Derick Rethans <derick@php.net> wrote:
> https://wiki.php.net/rfc/shorter_attribute_syntax_change#voting > >
Just chiming in to say all, y'all voting for @[...] are making a terrible choice, and are you sure you're okay with it? We have options with varying degrees of backward compatibility issues (<<>> none, @@ some, #[..] and @[..] a bit more than some), and only one which offers forward compatibility (#[..]). So why vote in favor of the option with the highest BC breaking probability and no FC? Thank you for coming to my TED talk. -Sara

Guilherme Blanco

6 years ago
Hi Sara, I'd like to explain my rationale. Most of the time I end up using "#[todo] Whatever" while documenting my code... my intentions are "# [todo] ...", but you know... missing that space char doesn't break anything today... In any case, BC is broken and FC would also not work. Now I assume it's a quite rare scenario where someone is doing: @[...] where suppressing is needed, especially when we check against the #[...] case. Cheers, On Tue, Aug 11, 2020 at 10:55 AM Sara Golemon <pollita@php.net> wrote:
> > On Mon, Aug 10, 2020 at 3:41 AM Derick Rethans <derick@php.net> wrote: > > > https://wiki.php.net/rfc/shorter_attribute_syntax_change#voting > > > > > Just chiming in to say all, y'all voting for @[...] are making a terrible > choice, and are you sure you're okay with it? > > We have options with varying degrees of backward compatibility issues (<<>> > none, @@ some, #[..] and @[..] a bit more than some), and only one which > offers forward compatibility (#[..]). > So why vote in favor of the option with the highest BC breaking probability > and no FC? > > Thank you for coming to my TED talk. > > -Sara
-- Guilherme Blanco SVP Technology at Statflo Inc. Mobile: +1 647 232 5599

Rowan Collins

6 years ago
On Tue, 11 Aug 2020 at 16:07, guilhermeblanco@gmail.com < guilhermeblanco@gmail.com> wrote:
> I'd like to explain my rationale. Most of the time I end up using > "#[todo] Whatever" while documenting my code... my intentions are "# > [todo] ...", but you know... missing that space char doesn't break > anything today... > In any case, BC is broken and FC would also not work. Now I assume > it's a quite rare scenario where someone is doing: @[...] where > suppressing is needed, especially when we check against the #[...] > case. >
This feels a bit arbitrary to me: the way you've worded it here makes it sound like because you use one and not the other, you've assumed that one is more common than the other. I've personally never used either, but can see situations where both would arise, and have absolutely no idea which is more common, and what the impact would be. My vote, if I had one, would remain under "No" for this re-vote. There seems to be no reason to allow this vote, but not allow another one next week with a new suggestion, and nothing objective to choose between the syntaxes. Regards,
-- Rowan Tommins [IMSoP]

Sara Golemon

6 years ago
On Tue, Aug 11, 2020 at 10:07 AM guilhermeblanco@gmail.com < guilhermeblanco@gmail.com> wrote:
> I'd like to explain my rationale. Most of the time I end up using > "#[todo] Whatever" while documenting my code... my intentions are "# > [todo] ...", but you know... missing that space char doesn't break > anything today... >
We could disagree on which is more common today @[] or #[], but I don't have the numbers, so it's useless to argue that point (though I will say that @[$foo, $bar] = explode(...); is valid syntax that does something while #[todo] whatever is just a comment and therefore a bit arbitrary. But again, I'll agree to disagree on which of those two comes out less problematic. Certainly in terms of YOUR vote, you can absolutely choose to vote for something which doesn't break your workflow and that's 100% valid. Certainly we can agree they have the same fundamental BC break chance. And have the same work-around for fixing (add a space).
> In any case, BC is broken and FC would also not work. > >
This is the part I replied to call out. You seem to be stating that "FC would also not work" on the #[...] syntac which is demonstrably false. Writing this on PHP 7 (or any earlier version for that matter) would be valid syntax (ignored as a comment): #[SomeAttr(123)] function someFunc() {} That's what's meant by Forward Compatibility. Library/Framework authors could aggressively adopt attributes with the #[...] syntax, they can NOT do so with any other syntax. -Sara

Andreas Leathley

6 years ago
On 11.08.20 18:07, Sara Golemon wrote:
> Writing this on PHP 7 (or any earlier version for that matter) would be > valid syntax (ignored as a comment): > > #[SomeAttr(123)] > function someFunc() {} > > That's what's meant by Forward Compatibility. Library/Framework authors > could aggressively adopt attributes with the #[...] syntax, they can NOT do > so with any other syntax.
This would be a feature if libraries start parsing PHP token by token and start supporting the #[] syntax for the 7.x versions of PHP - then early adoption would be possible and it would be a real feature. But it seems unclear if that will happen, as it will probably have a heavy price on performance (and might have some complexity). And if some libraries implement it but others don't, then it might get confusing for users about why the new attribute syntax sometimes works and sometimes silently does nothing. It is also not perfect as multi-line attributes with #[ still break, or code with #[] followed by more code instead of a newline and then more code.

Sara Golemon

6 years ago
On Tue, Aug 11, 2020 at 11:25 AM Andreas Leathley <a.leathley@gmx.net> wrote:
> This would be a feature if libraries start parsing PHP token by token > and start supporting the #[] syntax for the 7.x versions of PHP - then > early adoption would be possible and it would be a real feature. But it > seems unclear if that will happen, as it will probably have a heavy > price on performance (and might have some complexity). And if some > libraries implement it but others don't, then it might get confusing for > users about why the new attribute syntax sometimes works and sometimes > silently does nothing. > >
The perf penalty on 7 and earlier would probably be similar to existing state of the world. Parsing a docblock is easier to fetch from the runtime (as we actually store it), but docblocks contain more than just annotations, so some plus some minus. PHP 8+ performance on theses would certainly be between though, and that's an extra carrot to push users to upgrade. If annotations can't be written until after users upgrade, then that carrot vanishes.
> It is also not perfect as multi-line attributes with #[ still break, or > code with #[] followed by more code instead of a newline and then more > code. > >
That's true. It'll take some care (and possible reduction in readability) to make annotations work well across verisons, but it's better to have an option than not, no? -Sara

Sara Golemon

6 years ago
On Tue, Aug 11, 2020 at 11:38 AM Sara Golemon <pollita@php.net> wrote:
> PHP 8+ performance on theses would certainly be between though, and that's > an extra carrot to push users to upgrade. If annotations can't be written > until after users upgrade, then that carrot vanishes. >
*PHP 8+ performance on these would certainly be better though. Ugh... typing is hard. -Sara

Andreas Leathley

6 years ago
On 11.08.20 18:38, Sara Golemon wrote:
> The perf penalty on 7 and earlier would probably be similar to existing > state of the world. > Parsing a docblock is easier to fetch from the runtime (as we actually > store it), but docblocks contain more than just annotations, so some plus > some minus. > PHP 8+ performance on theses would certainly be between though, and that's > an extra carrot to push users to upgrade. If annotations can't be written > until after users upgrade, then that carrot vanishes.
If this is something that would realistically happen, I feel this would have needed more explanation in an RFC and maybe some small tests to demonstrate feasability, then it would be a big argument. I read through all the RFCs, but only realized the meaning of this argument now, with some more context. If the Doctrine Annotations library would support a syntax with # for pre-PHP-8 and it would be fast enough, then this argument would be more convincing to me than any of the others together. And it would not need to be #[], it could be any syntax that starts with # - it could also be #@, which definitely seems weird at first, but seems much less likely to occur in code than #[ and would be more similar to current annotations and Javascript syntax. Or it could be something completely different, like #~, which I cannot imagine ever comes up in actual code. Because Rust using the #[] syntax does not seem like an advantage, as Rust syntax in general looks completely different compared to PHP.

Nikita Popov

6 years ago
On Tue, Aug 11, 2020 at 6:26 PM Andreas Leathley <a.leathley@gmx.net> wrote:
> On 11.08.20 18:07, Sara Golemon wrote: > > Writing this on PHP 7 (or any earlier version for that matter) would be > > valid syntax (ignored as a comment): > > > > #[SomeAttr(123)] > > function someFunc() {} > > > > That's what's meant by Forward Compatibility. Library/Framework authors > > could aggressively adopt attributes with the #[...] syntax, they can NOT > do > > so with any other syntax. > > This would be a feature if libraries start parsing PHP token by token > and start supporting the #[] syntax for the 7.x versions of PHP - then > early adoption would be possible and it would be a real feature. But it > seems unclear if that will happen, as it will probably have a heavy > price on performance (and might have some complexity). And if some > libraries implement it but others don't, then it might get confusing for > users about why the new attribute syntax sometimes works and sometimes > silently does nothing. > > It is also not perfect as multi-line attributes with #[ still break, or > code with #[] followed by more code instead of a newline and then more > code. >
To clarify the forward compatibility argument: As far as I understood, it's not really about the end user, it's about the library implementing the attribute. The library providing the Route attribute can write: #[Attribute] class Route { // ... } and make the Route attribute available both for use with PHP 8 attributes and PHP 7 docblock annotations. With non-FC syntax choices this possibility does not exist, and the library will be required to provide different class hierarchies for docblock attributes and PHP 8 attributes. The ability to write #[Route] for the user of that library is an additional possibility on top of that, but one that is technically more involved. I think the primary forward compatibility value lies in the above usage. I believe this was explained in some of the earlier discussions, but I wanted to repeat it in this thread, as there seems to be some confusion on this point. Regards, Nikita

Paul M. Jones

6 years ago
> On Aug 11, 2020, at 09:54, Sara Golemon <pollita@php.net> wrote: > > On Mon, Aug 10, 2020 at 3:41 AM Derick Rethans <derick@php.net> wrote: > >> https://wiki.php.net/rfc/shorter_attribute_syntax_change#voting >> >> > Just chiming in to say all, y'all voting for @[...] are making a terrible > choice, and are you sure you're okay with it?
Maybe -- but we can always vote *yet again* on this, until the voters *finally* get it right.
-- Paul M. Jones pmjones@pmjones.io http://paul-m-jones.com Modernizing Legacy Applications in PHP https://leanpub.com/mlaphp Solving the N+1 Problem in PHP https://leanpub.com/sn1php

A.L.E.C

6 years ago
On 11.08.2020 16:54, Sara Golemon wrote:
>> https://wiki.php.net/rfc/shorter_attribute_syntax_change#voting
> Just chiming in to say all, y'all voting for @[...] are making a terrible > choice, and are you sure you're okay with it?
It looks like the community is split, and it might actually be a mistake to implement the feature with any of the options on the table. Maybe we should look for different approaches? Here's one. To not have to use a new keyword I choose to try how "declare" would fit: declare( SomeAttr, AntoherAttr("Hello world") ) class someClass { }
-- Aleksander Machniak Kolab Groupware Developer [https://kolab.org] Roundcube Webmail Developer [https://roundcube.net] ---------------------------------------------------- PGP: 19359DC1 # Blog: https://kolabian.wordpress.com

Theodore Brown

6 years ago
On Mon, Aug 10, 2020 at 3:41 AM Derick Rethans <derick@php.net> wrote: >I've just opened the vote to make sure we don't make a terrible mistake > with using the @@ syntax for attributes: > > https://wiki.php.net/rfc/shorter_attribute_syntax_change#voting > > The vote ends August 23, 24:00 UTC. It has just come to my attention that this RFC was rushed to vote after less than the minimum two week period required after it was brought up on list. Furthermore, discussion was still very active at that time - I certainly didn't have a chance to respond to some of the emails before voting began. Joe first announced this RFC on Tuesday, July 28 at 9:47 AM, and the vote was started this Monday at 3:41 AM, less than 12 days, 18 hours after the announcement. Per the voting rules: > a minimum of 2 weeks between when an RFC that touches the language > is brought up on this list and when it's voted on is required. [1] What should be done to prevent this rule from being violated? Also, I still don't understand why this RFC has a special exemption to the feature freeze deadline, given that the whole basis for it (a supposed lack of consistency) is at best a subjective opinion. Can the RMs please weigh in? Kind regards, Theodore [1]: https://wiki.php.net/RFC/voting#discussion_period

Sara Golemon

6 years ago
On Wed, Aug 12, 2020 at 9:48 AM Theodore Brown <theodorejb@outlook.com> wrote:
> It has just come to my attention that this RFC was rushed to vote > after less than the minimum two week period required after it was > brought up on list. Furthermore, discussion was still very active at > that time - I certainly didn't have a chance to respond to some of > the emails before voting began. > > Joe first announced this RFC on Tuesday, July 28 at 9:47 AM, and the > vote was started this Monday at 3:41 AM, less than 12 days, 18 hours > after the announcement. Per the voting rules: > >
So, 30 hours short of 2 weeks. I'm going to ascribe good intentions in trying to get the issue resolved in the minimal timeframe. The fact active discussion was ongoing makes this a questionable choice, but in my opinion, purely on a matter of time, quibbling over 30 hours is splitting hairs. Maybe compromise on adding time to the vote end period so that the total is greater than 4 weeks?
> What should be done to prevent this rule from being violated? > >
Vigilance. You're right to raise the concern. And let's wag a finger over it at least. If others agree that it's premature, we can stop the vote, but I'm not inclined to disrupt the process over such a small variance.
> Also, I still don't understand why this RFC has a special exemption > to the feature freeze deadline, given that the whole basis for it > (a supposed lack of consistency) is at best a subjective opinion. > >
Changing the syntax isn't a feature. It's a refinement. One of the things our long release process provides is a chance to be absolutely certain before we introduce syntax we'll come to regret later. -Sara

Paul M. Jones

6 years ago
> On Aug 12, 2020, at 10:25, Sara Golemon <pollita@php.net> wrote: > > If others agree that it's premature, we can stop the vote, > but I'm not inclined to disrupt the process over such a small variance.
It's premature. If we can't follow our own rules, why even have them?
-- Paul M. Jones pmjones@pmjones.io http://paul-m-jones.com Modernizing Legacy Applications in PHP https://leanpub.com/mlaphp Solving the N+1 Problem in PHP https://leanpub.com/sn1php

Kalle Sommer Nielsen

6 years ago
Den ons. 12. aug. 2020 kl. 18.29 skrev Paul M. Jones <pmjones@pmjones.io>:
> It's premature. If we can't follow our own rules, why even have them?
Agreed
-- regards, Kalle Sommer Nielsen kalle@php.net

Derick Rethans

6 years ago
On Wed, 12 Aug 2020, Sara Golemon wrote:
> Maybe compromise on adding time to the vote end period so that the > total is greater than 4 weeks?
You'd asked to get this done by beta3, which I miscalculated as being tagged on August 25th. But as it's actually a week later I have no problem extending it. cheers, Derick
-- PHP 7.4 Release Manager Host of PHP Internals News: https://phpinternals.news Like Xdebug? Consider supporting me: https://xdebug.org/support https://derickrethans.nl | https://xdebug.org | https://dram.io twitter: @derickr and @xdebug

Andreas Leathley

6 years ago
On 12.08.20 17:25, Sara Golemon wrote:
> Changing the syntax isn't a feature. It's a refinement. One of the things > our long release process provides is a chance to be absolutely certain > before we introduce syntax we'll come to regret later.
The current RFC does not discuss the BC breaks of each syntax (which seems very important to any syntax changes), it has not taken into account the discussion, and the RFC itself was being discussed for only 6 days (of which two days were on the weekend) before it started its voting process. The discussion was still very much ongoing when voting started. Shoehorning in a syntax at the last minute seems like the opposite of a controlled and long-term release process, at least if there is an ongoing discussion. Looking at the RFC votes now, the opinions are clearly split, which is not a good sign - at least in the previous RFC @@ was a clear winner. Changing syntax again now for the third time could just as well be the decision that will be regretted later on, instead of finding a better concensus in due time.

Theodore Brown

6 years ago
On Wed, Aug 12, 2020 at 10:25 AM Sara Golemon <pollita@php.net> wrote: > On Wed, Aug 12, 2020 at 9:48 AM Theodore Brown wrote: > > > It has just come to my attention that this RFC was rushed to vote > > after less than the minimum two week period required after it was > > brought up on list. Furthermore, discussion was still very active at > > that time - I certainly didn't have a chance to respond to some of > > the emails before voting began. > > > > Joe first announced this RFC on Tuesday, July 28 at 9:47 AM, and the > > vote was started this Monday at 3:41 AM, less than 12 days, 18 hours > > after the announcement. Per the voting rules: > > So, 30 hours short of 2 weeks. I'm going to ascribe good intentions > in trying to get the issue resolved in the minimal timeframe. The > fact active discussion was ongoing makes this a questionable choice, > but in my opinion, purely on a matter of time, quibbling over 30 hours > is splitting hairs. Maybe compromise on adding time to the vote end > period so that the total is greater than 4 weeks? > > > What should be done to prevent this rule from being violated? > > Vigilance. You're right to raise the concern. And let's wag a finger > over it at least. If others agree that it's premature, we can stop > the vote, but I'm not inclined to disrupt the process over such a > small variance. On top of violating the minimum two week discussion period, I believe this RFC also breaks the rule on resurrecting failed proposals. When I authored the Shorter Attribute Syntax RFC, I specifically did not include a voting option for `@:`, since this syntax was declined, and my understanding was that a six month waiting period is required before resurrecting rejected proposals. [1] But if we can vote again on `#[]` and `<<>>` after they were declined, why can't we also vote again for `@:`? This syntax has the advantage of being equally short as `@@` without any BC break. I'm really disappointed and disillusioned with how the process has been handled for this RFC. It seems like the rules are arbitrarily going out the window in order to keep voting until the desired result is reached. What is the point of having rules if they aren't followed or enforced? If anyone else is troubled by the precedent being set by this RFC, please vote No on the primary vote. I'm not sure what other recourse we have at this point. Sincerely, Theodore [1]: https://wiki.php.net/rfc/voting#resurrecting_rejected_proposals

Michał Brzuchalski

6 years ago
Hi Theodore, śr., 12 sie 2020 o 18:36 Theodore Brown <theodorejb@outlook.com> napisał(a):
> On Wed, Aug 12, 2020 at 10:25 AM Sara Golemon <pollita@php.net> wrote: > > > On Wed, Aug 12, 2020 at 9:48 AM Theodore Brown wrote: > > > > > It has just come to my attention that this RFC was rushed to vote > > > after less than the minimum two week period required after it was > > > brought up on list. Furthermore, discussion was still very active at > > > that time - I certainly didn't have a chance to respond to some of > > > the emails before voting began. > > > > > > Joe first announced this RFC on Tuesday, July 28 at 9:47 AM, and the > > > vote was started this Monday at 3:41 AM, less than 12 days, 18 hours > > > after the announcement. Per the voting rules: > > > > So, 30 hours short of 2 weeks. I'm going to ascribe good intentions > > in trying to get the issue resolved in the minimal timeframe. The > > fact active discussion was ongoing makes this a questionable choice, > > but in my opinion, purely on a matter of time, quibbling over 30 hours > > is splitting hairs. Maybe compromise on adding time to the vote end > > period so that the total is greater than 4 weeks? > > > > > What should be done to prevent this rule from being violated? > > > > Vigilance. You're right to raise the concern. And let's wag a finger > > over it at least. If others agree that it's premature, we can stop > > the vote, but I'm not inclined to disrupt the process over such a > > small variance. > > On top of violating the minimum two week discussion period, I believe > this RFC also breaks the rule on resurrecting failed proposals. When > I authored the Shorter Attribute Syntax RFC, I specifically did not > include a voting option for `@:`, since this syntax was declined, > and my understanding was that a six month waiting period is required > before resurrecting rejected proposals. [1] > > But if we can vote again on `#[]` and `<<>>` after they were declined, > why can't we also vote again for `@:`? This syntax has the advantage > of being equally short as `@@` without any BC break. > > I'm really disappointed and disillusioned with how the process has > been handled for this RFC. It seems like the rules are arbitrarily > going out the window in order to keep voting until the desired result > is reached. > > What is the point of having rules if they aren't followed or enforced? > If anyone else is troubled by the precedent being set by this RFC, > please vote No on the primary vote. I'm not sure what other recourse > we have at this point. > > Sincerely, > Theodore > > [1]: https://wiki.php.net/rfc/voting#resurrecting_rejected_proposals
You hint to the fact of shorter discussion period and the fact that you haven't got time to respond to all discussions while if you take a closer look on ML [4] that is obvious that discussion in fact began earlier and it's 3 weeks from now and to avoid insinuation you replied to it [5] 3 weeks ago as well. You blame others for breaking rules which in fact are not broken. IMO you think they're broken cause of your own interpretation. Rejected features have nothing to do with a re-vote on a syntax change at least this is how I understand this. Besides you already mentioned this argument on ML [1] so we can argue actually if a re-vote on syntax change is actually resurrecting a declined proposal since it was not a standalone proposal which got into a declined section of RFC's index [2] and yet you did it again! You blame others for "abusing" the RFC process while you've brought to us an RFC with a significant ambiguity [3] which you haven't mention and it turned out after closing a vote. Personally I think that it was your huge failure to bring the previous @@ syntax change RFC up to the voting without checking it's correctness. I'm personally also disappointed with the fact that in your RFC under the primary vote question "Are you okay with re-voting on the attribute syntax for PHP 8.0?" removing features like grouping ability was hidden. Personally I think you're forcing to stop the re-vote cause of mental connection to your previous @@ RFC and trying hard to find an argument against the re-vote. From the results which are available so far, it can be seen that your proposed syntax is no longer the leading one. I understand it fully cause I'd be upset as well. From my own experience, I know that as a RFC author there has always be a place to just let it go cause you won't always get to convince 50+ voters to your PoV. Cheers, Michał Marcin Brzuchalski [1]: https://externals.io/message/111218#111254 [2]: https://wiki.php.net/rfc#declined [3]: https://externals.io/message/110640#110819 [4]: https://externals.io/message/111101#111101 [5]: https://externals.io/message/111101#111132

Côme Chilliet

6 years ago
Le Thu, 13 Aug 2020 10:13:16 +0200, Michał Marcin Brzuchalski <michal.brzuchalski@gmail.com> a écrit :
> I'm personally also disappointed with the fact that in your RFC under the > primary > vote question "Are you okay with re-voting on the attribute syntax for PHP > 8.0?" > removing features like grouping ability was hidden.
I still do not understand this point on grouping, how is using a syntax like @@ or any that does not require grouping removing anything? What is the grouping feature supposed to do?

Theodore Brown

6 years ago
On Thu, Aug 13, 2020 at 3:13 AM Michał Marcin Brzuchalski <michal.brzuchalski@gmail.com> wrote: > Hi Theodore, > > śr., 12 sie 2020 o 18:36 Theodore Brown <theodorejb@outlook.com> napisał(a): > > On Wed, Aug 12, 2020 at 10:25 AM Sara Golemon <pollita@php.net> wrote: > > > > > On Wed, Aug 12, 2020 at 9:48 AM Theodore Brown wrote: > > > > > > > It has just come to my attention that this RFC was rushed to vote > > > > after less than the minimum two week period required after it was > > > > brought up on list. Furthermore, discussion was still very active at > > > > that time - I certainly didn't have a chance to respond to some of > > > > the emails before voting began. > > > > > > > > Joe first announced this RFC on Tuesday, July 28 at 9:47 AM, and the > > > > vote was started this Monday at 3:41 AM, less than 12 days, 18 hours > > > > after the announcement. Per the voting rules: > > > > > > So, 30 hours short of 2 weeks. I'm going to ascribe good intentions > > > in trying to get the issue resolved in the minimal timeframe. The > > > fact active discussion was ongoing makes this a questionable choice, > > > but in my opinion, purely on a matter of time, quibbling over 30 hours > > > is splitting hairs. Maybe compromise on adding time to the vote end > > > period so that the total is greater than 4 weeks? > > > > > > > What should be done to prevent this rule from being violated? > > > > > > Vigilance. You're right to raise the concern. And let's wag a finger > > > over it at least. If others agree that it's premature, we can stop > > > the vote, but I'm not inclined to disrupt the process over such a > > > small variance. > > > > On top of violating the minimum two week discussion period, I believe > > this RFC also breaks the rule on resurrecting failed proposals. When > > I authored the Shorter Attribute Syntax RFC, I specifically did not > > include a voting option for `@:`, since this syntax was declined, > > and my understanding was that a six month waiting period is required > > before resurrecting rejected proposals. [1] > > > > But if we can vote again on `#[]` and `<<>>` after they were declined, > > why can't we also vote again for `@:`? This syntax has the advantage > > of being equally short as `@@` without any BC break. > > > > I'm really disappointed and disillusioned with how the process has > > been handled for this RFC. It seems like the rules are arbitrarily > > going out the window in order to keep voting until the desired result > > is reached. > > > > What is the point of having rules if they aren't followed or enforced? > > If anyone else is troubled by the precedent being set by this RFC, > > please vote No on the primary vote. I'm not sure what other recourse > > we have at this point. > > > > Sincerely, > > Theodore > > > > [1]: https://wiki.php.net/rfc/voting#resurrecting_rejected_proposals > > You hint to the fact of shorter discussion period and the fact that > you haven't got time to respond to all discussions while if you take > a closer look on ML [4] that is obvious that discussion in fact began > earlier and it's 3 weeks from now and to avoid insinuation you replied > to it [5] 3 weeks ago as well. Hi Michał, The discussion thread you're referencing did not announce an RFC. Per the voting rules, a "Proposal is formally initiated by creating an RFC on PHP wiki and announcing it on the list". After that there must be a minimum two week discussion period before voting starts. The Shorter Attribute Syntax Change RFC failed to meet this requirement. > Rejected features have nothing to do with a re-vote on a syntax > change at least this is how I understand this. Besides you already > mentioned this argument on ML [1] so we can argue actually if a > re-vote on syntax change is actually resurrecting a declined > proposal since it was not a standalone proposal which got into a > declined section of RFC's index [2] and yet you did it again! So you're saying that the rule on resurrecting failed proposals only applies to primary votes, and not secondary votes? So if a secondary vote fails it's okay to vote for it again and again until the desired result it reached? This is not my understanding of the rules. > You blame others for "abusing" the RFC process while you've brought > to us an RFC with a significant ambiguity [3] which you haven't > mention and it turned out after closing a vote. Personally I think > that it was your huge failure to bring the previous @@ syntax change > RFC up to the voting without checking it's correctness. It was correct as far as we knew at the time. Anyway, this issue was fixed before the @@ syntax was merged, and I don't see its relevance to this discussion. > I'm personally also disappointed with the fact that in your RFC under > the primary vote question "Are you okay with re-voting on the > attribute syntax for PHP 8.0?" removing features like grouping > ability was hidden. I don't follow you. The grouping feature for <<>> wasn't even accepted yet when the Shorter Attribute Syntax RFC went to vote. One of the primary motivations of the Shorter Attribute Syntax RFC was to reduce verbosity and remove the need for two different syntaxes (grouped and non-grouped) for declaring attributes. It was also discussed on list how @@ is equally or more concise without grouping: https://externals.io/message/110355#110414. Finally, the Attribute Amendments RFC itself explicitly stated that the grouped attribute feature "would be superseded by any other RFC getting accepted that changes the syntax." Attribute grouping makes some sense to help reduce the verbosity of the @[], #[], and especially <<>> syntaxes, but with @@ there is no need for the extra complexity since it is equally concise without it. > Personally I think you're forcing to stop the re-vote cause of mental > connection to your previous @@ RFC and trying hard to find an argument > against the re-vote. From the results which are available so far, it > can be seen that your proposed syntax is no longer the leading one. > I understand it fully cause I'd be upset as well. If it was just a matter of my personal syntax preference I wouldn't be having this discussion. I was fine with voting on #[] originally and included it as an option in the Shorter Attribute Syntax RFC. What I have a serious problem with is breaking rules to arbitrarily vote again in the hopes that this time voters will choose #[] even though it was declined in the last vote. Moreover, the current RFC does not fairly present all the pros and cons of each syntax, and the requests of myself and others to include additional important details in the RFC about the BC breaks and other considerations have not been heeded. What is happening here is wrong, and because I want the best for PHP I have to stand up to it. Sincerely, Theodore > [1]: https://externals.io/message/111218#111254 > [2]: https://wiki.php.net/rfc#declined > [3]: https://externals.io/message/110640#110819 > [4]: https://externals.io/message/111101#111101 > [5]: https://externals.io/message/111101#111132

Michał Brzuchalski

6 years ago
Hi Theodore, czw., 13 sie 2020 o 15:17 Theodore Brown <theodorejb@outlook.com> napisał(a):
> On Thu, Aug 13, 2020 at 3:13 AM Michał Marcin Brzuchalski < > michal.brzuchalski@gmail.com> wrote: > > > Hi Theodore, > > > > śr., 12 sie 2020 o 18:36 Theodore Brown <theodorejb@outlook.com> > napisał(a): > > > On Wed, Aug 12, 2020 at 10:25 AM Sara Golemon <pollita@php.net> wrote: > > > > > > > On Wed, Aug 12, 2020 at 9:48 AM Theodore Brown wrote: > > > > > > > > > It has just come to my attention that this RFC was rushed to vote > > > > > after less than the minimum two week period required after it was > > > > > brought up on list. Furthermore, discussion was still very active > at > > > > > that time - I certainly didn't have a chance to respond to some of > > > > > the emails before voting began. > > > > > > > > > > Joe first announced this RFC on Tuesday, July 28 at 9:47 AM, and > the > > > > > vote was started this Monday at 3:41 AM, less than 12 days, 18 > hours > > > > > after the announcement. Per the voting rules: > > > > > > > > So, 30 hours short of 2 weeks. I'm going to ascribe good intentions > > > > in trying to get the issue resolved in the minimal timeframe. The > > > > fact active discussion was ongoing makes this a questionable choice, > > > > but in my opinion, purely on a matter of time, quibbling over 30 > hours > > > > is splitting hairs. Maybe compromise on adding time to the vote end > > > > period so that the total is greater than 4 weeks? > > > > > > > > > What should be done to prevent this rule from being violated? > > > > > > > > Vigilance. You're right to raise the concern. And let's wag a finger > > > > over it at least. If others agree that it's premature, we can stop > > > > the vote, but I'm not inclined to disrupt the process over such a > > > > small variance. > > > > > > On top of violating the minimum two week discussion period, I believe > > > this RFC also breaks the rule on resurrecting failed proposals. When > > > I authored the Shorter Attribute Syntax RFC, I specifically did not > > > include a voting option for `@:`, since this syntax was declined, > > > and my understanding was that a six month waiting period is required > > > before resurrecting rejected proposals. [1] > > > > > > But if we can vote again on `#[]` and `<<>>` after they were declined, > > > why can't we also vote again for `@:`? This syntax has the advantage > > > of being equally short as `@@` without any BC break. > > > > > > I'm really disappointed and disillusioned with how the process has > > > been handled for this RFC. It seems like the rules are arbitrarily > > > going out the window in order to keep voting until the desired result > > > is reached. > > > > > > What is the point of having rules if they aren't followed or enforced? > > > If anyone else is troubled by the precedent being set by this RFC, > > > please vote No on the primary vote. I'm not sure what other recourse > > > we have at this point. > > > > > > Sincerely, > > > Theodore > > > > > > [1]: https://wiki.php.net/rfc/voting#resurrecting_rejected_proposals > > > > You hint to the fact of shorter discussion period and the fact that > > you haven't got time to respond to all discussions while if you take > > a closer look on ML [4] that is obvious that discussion in fact began > > earlier and it's 3 weeks from now and to avoid insinuation you replied > > to it [5] 3 weeks ago as well. > > Hi Michał, > > The discussion thread you're referencing did not announce an RFC. Per > the voting rules, a "Proposal is formally initiated by creating an > RFC on PHP wiki and announcing it on the list". After that there must > be a minimum two week discussion period before voting starts. The > Shorter Attribute Syntax Change RFC failed to meet this requirement. >
True, but you cannot disagree that you knew about the discussion coming soon and yet it was 3 weeks ago. True that the announcement was delayed but TBH for me, discussion began earlier and we argue about that while more than 43 votes who voted yes in the primary vote had no hard feelings about it.
> > Rejected features have nothing to do with a re-vote on a syntax > > change at least this is how I understand this. Besides you already > > mentioned this argument on ML [1] so we can argue actually if a > > re-vote on syntax change is actually resurrecting a declined > > proposal since it was not a standalone proposal which got into a > > declined section of RFC's index [2] and yet you did it again! > > So you're saying that the rule on resurrecting failed proposals only > applies to primary votes, and not secondary votes? So if a secondary > vote fails it's okay to vote for it again and again until the desired > result it reached? This is not my understanding of the rules. >
Agree. This is how I understand this and this is my personal opinion on that.
> You blame others for "abusing" the RFC process while you've brought > > to us an RFC with a significant ambiguity [3] which you haven't > > mention and it turned out after closing a vote. Personally I think > > that it was your huge failure to bring the previous @@ syntax change > > RFC up to the voting without checking it's correctness. > > It was correct as far as we knew at the time. Anyway, this issue was > fixed before the @@ syntax was merged, and I don't see its relevance > to this discussion. >
I do not hint to the fact that the issue was accidentally fixed due to another planned RFC. The thing I do hint about here is the fact that the RFC even got into voting with an ambiguity issue and that's a failure of RFC's author. This proves RFC authors make mistakes all the time and since this vote being in the vote for couple of days have so much yes votes on primary poll proves that mistakes to some degree might be forgiven. In case of your mistake AFAIK nobody asked you to withdraw accepted RFC after a mistake made by you was found, right?
> I'm personally also disappointed with the fact that in your RFC under > > the primary vote question "Are you okay with re-voting on the > > attribute syntax for PHP 8.0?" removing features like grouping > > ability was hidden. > > I don't follow you. The grouping feature for <<>> wasn't even accepted > yet when the Shorter Attribute Syntax RFC went to vote. One of the > primary motivations of the Shorter Attribute Syntax RFC was to reduce > verbosity and remove the need for two different syntaxes (grouped and > non-grouped) for declaring attributes. It was also discussed on list > how @@ is equally or more concise without grouping: > https://externals.io/message/110355#110414. Finally, the Attribute > Amendments RFC itself explicitly stated that the grouped attribute > feature "would be superseded by any other RFC getting accepted that > changes the syntax." > > Attribute grouping makes some sense to help reduce the verbosity of > the @[], #[], and especially <<>> syntaxes, but with @@ there is no > need for the extra complexity since it is equally concise without it. > > > Personally I think you're forcing to stop the re-vote cause of mental > > connection to your previous @@ RFC and trying hard to find an argument > > against the re-vote. From the results which are available so far, it > > can be seen that your proposed syntax is no longer the leading one. > > I understand it fully cause I'd be upset as well. > > If it was just a matter of my personal syntax preference I wouldn't > be having this discussion. I was fine with voting on #[] originally > and included it as an option in the Shorter Attribute Syntax RFC. > > What I have a serious problem with is breaking rules to arbitrarily > vote again in the hopes that this time voters will choose #[] even > though it was declined in the last vote. Moreover, the current RFC > does not fairly present all the pros and cons of each syntax, and > the requests of myself and others to include additional important > details in the RFC about the BC breaks and other considerations have > not been heeded. > > What is happening here is wrong, and because I want the best for PHP > I have to stand up to it. >
Here we agree. I also do want the best for PHP! Cheers, Michał Marcin Brzuchalski

Andreas Leathley

6 years ago
On 13.08.20 15:17, Theodore Brown wrote:
> The discussion thread you're referencing did not announce an RFC. Per > the voting rules, a "Proposal is formally initiated by creating an > RFC on PHP wiki and announcing it on the list". After that there must > be a minimum two week discussion period before voting starts. The > Shorter Attribute Syntax Change RFC failed to meet this requirement.
After reading https://wiki.php.net/rfc/howto it is stated clearly there that an RFC has to be created and be "Under Discussion" for at least two weeks. So you were actually wrong that the RFC was one day early - it was at least 8 days early, as the RFC was created and announced on the 4th of August and then put to vote on the 10th of August. It also states in this document: * Listen to the feedback, and try to answer/resolve all questions * Update your RFC to document all the issues and discussions * Cover both the positive and negative arguments Can anybody say with a straight face that this has been done in this case? Just one example: It still states in the RFC that the ending symbol is inconsistent with the language, although multiple people argued another viewpoint about this part with detailed explanations. This kind of discussion belongs in an RFC to show both sides, not just the one that suits the person writing the RFC.

Theodore Brown

6 years ago
On Thu, Aug 13, 2020 at 8:47 AM Andreas Leathley <a.leathley@gmx.net> wrote: > On 13.08.20 15:17, Theodore Brown wrote: > > The discussion thread you're referencing did not announce an RFC. Per > > the voting rules, a "Proposal is formally initiated by creating an > > RFC on PHP wiki and announcing it on the list". After that there must > > be a minimum two week discussion period before voting starts. The > > Shorter Attribute Syntax Change RFC failed to meet this requirement. > > After reading https://wiki.php.net/rfc/howto it is stated clearly there > that an RFC has to be created and be "Under Discussion" for at least two > weeks. So you were actually wrong that the RFC was one day early - it > was at least 8 days early, as the RFC was created and announced on the > 4th of August and then put to vote on the 10th of August. Indeed, it looks like you are right. I missed that Joe withdrew his RFC on August 2nd: https://externals.io/message/111218#111288. The declined RFC can still be viewed via a past page revision. [1] Apparently Derick then authored a new proposal under the same wiki URL and moved it under discussion on August 4th, with a request that people submit patches for other syntax alternatives to include in the vote. [2] So the first date this RFC could be eligible for voting is Tuesday August 18th. Sara and Gabriel, can you confirm this is the case? The RFC was then moved to voting on August 10th, less than a week later, before there was a reasonable period to submit patches, and while there was still significant ongoing and unresolved discussion. > It also states in this document: > > * Listen to the feedback, and try to answer/resolve all questions > * Update your RFC to document all the issues and discussions > * Cover both the positive and negative arguments > > Can anybody say with a straight face that this has been done in this > case? Just one example: It still states in the RFC that the ending > symbol is inconsistent with the language, although multiple people > argued another viewpoint about this part with detailed explanations. > This kind of discussion belongs in an RFC to show both sides, not > just the one that suits the person writing the RFC. Hear, hear. If we must vote again on the syntax, can the RFC at least fairly present all the pros and cons for each alternative (including details about the BC breaks), with a discussion section summarizing the viewpoints brought up on list? This is what I attempted to do in the original Shorter Attribute Syntax RFC. [3] Best regards, Theodore [1]: https://wiki.php.net/rfc/shorter_attribute_syntax_change?rev=1596407928 [2]: https://externals.io/message/111312#111312 [3]: https://wiki.php.net/rfc/shorter_attribute_syntax#alternative_syntax

Paul M. Jones

6 years ago
> On Aug 13, 2020, at 10:44, Theodore Brown <theodorejb@outlook.com> wrote: > > Indeed, it looks like you are right. I missed that Joe withdrew his > RFC on August 2nd: https://externals.io/message/111218#111288. The > declined RFC can still be viewed via a past page revision. [1] > > Apparently Derick then authored a new proposal under the same wiki > URL and moved it under discussion on August 4th, with a request that > people submit patches for other syntax alternatives to include in the > vote. [2] So the first date this RFC could be eligible for voting is > Tuesday August 18th.
So, a week+ early, then? Surely that means the current vote null and void, to be reset entirely following a proper discussion period -- one without concurrent voting.
-- Paul M. Jones pmjones@pmjones.io http://paul-m-jones.com Modernizing Legacy Applications in PHP https://leanpub.com/mlaphp Solving the N+1 Problem in PHP https://leanpub.com/sn1php

Unnamed Person

6 years ago
> So, a week+ early, then? Surely that means the current vote null and void, to be reset entirely following a proper discussion period -- one without concurrent voting.
I just want to make sure I understand: there are people who think we haven't discussed the syntax for attributes yet? I assume this is a serious email, but I can't fathom why anyone cares. We've discussed this subject soo much...

tyson andre

6 years ago
Hi internals, One thing I hadn't thought of before was how this would interact with parameters (with or without constructor property promotion). Many coding styles would end up putting annotations on the same line for parameters (in addition to closures) E.g. I've commonly done that and seen that done in Java: https://stackoverflow.com/questions/30237266/java-parameter-annotations ``` class X { public function __construct( @@MyImmutable public bool $x, private bool $flag = false, ) {} public function __construct( @[MyImmutable] public bool $x, private bool $flag = false, ) {} // This comments out the first parameter entirely in php7, silently leading to different behavior in php 7 public function __construct( #[MyImmutable] public bool $x, private bool $flag = false, ) {} } ``` As Theodore said, this RFC doesn't include enough examples to give a comprehensive understanding of how #[] would be implemented and what the implementation implies, which the original shorter attribute syntax did https://wiki.php.net/rfc/shorter_attribute_syntax#alternative_syntax (e.g. this gets parsed as `$f1 = $f2 = $object = new foo();` in php 7 and would not warn with your patch (from the mailing list) in php8. No patch for #[Attr] is linked in the RFC document.) ``` $f1 = #[ExampleAttribute] function () {}; $f2 = #[ExampleAttribute] fn() => 1; $object = new #[ExampleAttribute] class () {}; foo(); ``` Even if the RFC was amended after the vote was started, I don't think that people who had already voted would see the changes or read all of the numerous emails in this thread. > Changes lexing of remaining tokens indicates that a newly introduced token changes the behaviour of existing tokens. > In the example of `#[` the occurance of a # would have previously always signified a comment, but that now changes to become an attribute instead when followed by `[`. That's similar to saying that the `??` token would have previously indicated a `?` for a nullable type/ternary, but would change to become a null coalescing operator when followed by `?`. It understates/omits mentions of the changes to lexing this can cause, which I mentioned in https://externals.io/message/111218#111239 ``` ?php // This example echoes the rest of the source code in php 7 // and echoes "Test" in php 8. #[DeprecationReason('reason: <https://some-website/reason?>')] function main() {} const APP_SECRET = 'app-secret'; echo "Test\n"; ``` ``` // yields false in php 7, yields a function in php 8 function generator() { yield #[MyCustomAttribute(' false; // ']function() {}; } ``` Regards, - Tyson

Benjamin Eberlei

6 years ago
Following the valid criticisms of us starting the vote too early, we have closed the vote for this RFC for now. We look to restart the vote middle next week, so that we can close this before the Beta 3 release on September 3rd. We have updated the RFC at https://wiki.php.net/rfc/shorter_attribute_syntax_change with what we think covers all the discussion and arguments made in this and the previous mailing list threads. Sorry to everyone for causing this hazzle. On Mon, Aug 10, 2020 at 10:41 AM Derick Rethans <derick@php.net> wrote:

Michał Brzuchalski

6 years ago
Hi Benjamin, niedz., 16 sie 2020, 11:29 użytkownik Benjamin Eberlei <kontakt@beberlei.de> napisał:
> Following the valid criticisms of us starting the vote too early, we have > closed the vote for this RFC for now. > > We look to restart the vote middle next week, so that we can close this > before the Beta 3 release on September 3rd. > > We have updated the RFC at > https://wiki.php.net/rfc/shorter_attribute_syntax_change with what we > think > covers all the discussion and arguments made in this and the previous > mailing list threads. > > Sorry to everyone for causing this hazzle. > > On Mon, Aug 10, 2020 at 10:41 AM Derick Rethans <derick@php.net> wrote: > > > Hi, > > > > I've just opened the vote to make sure we don't make a terrible mistake > > with using the @@ syntax for attributes: > > > > https://wiki.php.net/rfc/shorter_attribute_syntax_change#voting > > > > The first vote is a vote to say that you have an opinion about attribute > > syntax. Make sure to read up on the discussion on the mailinglist if you > > haven't done so yet. > > > > The second vote is an STV vote. > > > > In STV you SHOULD rank *all* choices, but don't pick the same one more > > than once, as that will invalidate your vote. > > > > Please have a objective look at the table > > (https://wiki.php.net/rfc/shorter_attribute_syntax_change#proposal) and > > don't just go by asthetics. >
Thank you for working on this. Recent update doesn't change my vote but made me even more confident about arguments behind #[] syntax. The table which compares different syntaxes have an amount of minimum chars needed for writing attribute but what I've noticed is that it differs when considering more than 2 attributes in groupped syntax. What I mean is that @@ requires always 2*N amount of chars which for 3 attributes is 6 while for syntaxes like #[] it is only 3 for N=1 and only 3+N-1 for N>1 which for 3 attributes is only 5 and adds always only 1 additional required chars for next additional attribute due to fact that grouped syntax requires only one comma "," between attributes. Cheers, Michał Marcin Brzuchalski

Peter Bowyer

6 years ago
On Sun, 16 Aug 2020 at 10:29, Benjamin Eberlei <kontakt@beberlei.de> wrote:
> We have updated the RFC at > https://wiki.php.net/rfc/shorter_attribute_syntax_change with what we > think > covers all the discussion and arguments made in this and the previous > mailing list threads. >
Thank you for putting in the work it took to revise the RFC. It's good. I now understand what the delimiters achieve. While I don't agree with the first point in "Forcing @@ Attributes to end with parenthesis does not solve issues" (in this new syntax I'd ban whitespace) I appreciate the point you are making, and it is sensible for consistency. I feel grep'ability has been played down, as unless @@ MyProject\FooAttr is allowed (which isn't shown in the codeblock), then it's easier to grep for @@.+?Foo and know you have a chance of an accurate match (assuming renaming is not used) than it is with the delimiter syntax.
> Sorry to everyone for causing this hazzle. >
These things happen. Thank you for taking on-board the feedback and working on the RFC. Peter

Sara Golemon

6 years ago
On Sun, Aug 16, 2020 at 4:29 AM Benjamin Eberlei <kontakt@beberlei.de> wrote:
> Following the valid criticisms of us starting the vote too early, we have > closed the vote for this RFC for now. > > We look to restart the vote middle next week, so that we can close this > before the Beta 3 release on September 3rd. > >
Adding publicly that Gabriel and I have both signed off on this, and that it should be noted that because the vote will finish at end of day on September 2nd, any change to syntax resulting from this vote won't actually show in the beta3 build (which will have been cut on the 1st). So expect to see the result of this vote, whatever it may be, in the RC1 release. -Sara

Deleu

6 years ago
As stated by the RFC: We argue why we should strongly favor a syntax with closing delimiter to
> keep consistency with other parts of the language and propose to use #[], > @[], or the original << … >> instead.
Given the desire for a closing delimiter, has `@:Attr;` been considered (or even `@@Attr;`)? Can `;` be the closing token as it's already used for statements as well? On Mon, Aug 10, 2020 at 10:41 AM Derick Rethans <derick@php.net> wrote:
> Hi, > > I've just opened the vote to make sure we don't make a terrible mistake > with using the @@ syntax for attributes: > > https://wiki.php.net/rfc/shorter_attribute_syntax_change#voting > > The first vote is a vote to say that you have an opinion about attribute > syntax. Make sure to read up on the discussion on the mailinglist if you > haven't done so yet. > > The second vote is an STV vote. > > In STV you SHOULD rank *all* choices, but don't pick the same one more > than once, as that will invalidate your vote. > > Please have a objective look at the table > (https://wiki.php.net/rfc/shorter_attribute_syntax_change#proposal) and > don't just go by asthetics. > > The vote ends August 23, 24:00 UTC. > > cheers, > Derick > > -- > PHP 7.4 Release Manager > Host of PHP Internals News: https://phpinternals.news > Like Xdebug? Consider supporting me: https://xdebug.org/support > https://derickrethans.nl | https://xdebug.org | https://dram.io > twitter: @derickr and @xdebug > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > >
-- Marco Aurélio Deleu