On Sat, Sep 3, 2022, at 5:38 PM, Larry Garfield wrote:
> In case some people didn't see it in the previous thread, I am bumping 
> this poll:
>
> https://docs.google.com/forms/d/e/1FAIpQLSefq15VvGNIXSnQaMTl3RW451w0E8oesny8c4PLqmKl8HhQ-Q/viewform
>
> This is an informal poll on behalf of Ilija and I to determine the 
> syntax pattern we end up using for both Asymmetric Visibility and 
> Property accessor hooks.  We in particular want to get feedback from 
> RFC voters, because as we all know "discussion on the list" is 
> frequently highly unrepresentative of the actual voter sentiment, and 
> finding out "I like the idea just not that particular syntax" after a 
> vote fails, well, sucks for everyone.
>
> If you are planning to vote at all on either RFC, please take a few 
> moments to read the question being asked and give us feedback so we can 
> produce something acceptable to the broadest number of people.

Hi folks.  I've now closed the previous poll regarding asymmetric visibility 
and have some results.  

Total responses: 33
Voter responses: 11

## Question 1

This question asked people to scale-rate between Swift-style (1) and C# style 
(7).  The final counts were:

1: 6
2: 7
3: 4
4: 4
5: 3
6: 3
7: 6

Which roughly translates as "opinions are very split and all over the map, 
*but* there is a notable lean toward Swift-style."  In particular, there were 
13 "Strongly or very strongly Swift" responses to 9 "Strongly or very strongly 
C#" responses, and the middle responses also leaned slightly Swift-style.

Looking at the text responses people gave (thanks!), there were a sizable 
number of supporters of either model that said it "just felt better" or "feels 
more natural" for subjective reasons.  Much of the C# support came from the 
fact that more PHP developers seem to also have C# experience than Swift 
experience, so there was simply a familiarity question at play.  (Which is 
relevant, to be clear.)

Among the non-feel comments, most were critical of the added user-facing 
complexity of C# style in PHP (because of references), and therefore favored 
Swift.

If we restrict the results to just people with voting access, we get an average 
rating of 3.909, or almost a perfect tie.  (Figures.)  

Based on the above, Ilija and I plan to continue on with Swift-style syntax.  
Although it is not universally preferred, it does seem to have somewhat 
stronger support and more cleanly separates the two features syntactically, as 
they are orthogonal to each other.

## Question 2

The next question was what syntax to use for the set-visibility, which was 
conducted with an RCV model.  I computed the results using a slightly modified 
version of Derick's counter that is used for RFC votes.  (I just tweaked it to 
take in data from the Google Form rather than the Wiki's output format. The 
counting engine is unchanged.)

I was really surprised at the results.  In the first round, `private(set)` had 
a plurality lead over `public(set: private)` in second place:

Candidate 'private(set)': 12 → 1 2 4 8 12 13 22 25 27 28 29 30
Candidate '(set: private)': 9 → 3 10 17 19 20 21 24 26 31
Candidate 'public private': 5 → 7 9 14 16 23
Candidate 'private:set': 3 → 0 5 6
Candidate 'public:private': 3 → 11 15 18

I really expected `private:set` to do better, given how many people seemed to 
be anti-parentheses, yet the top two responses were the ones with parentheses.  
From examining the votes, `public(set: private)` was very much a "love it or 
hate it" response.  The rest of the rounds confirmed the same results:

Round 2:
Candidate 'private(set)': 12 → 1 2 4 8 12 13 22 25 27 28 29 30
Candidate '(set: private)': 9 → 3 10 17 19 20 21 24 26 31
Candidate 'public private': 6 → 7 9 14 16 23 15
Candidate 'private:set': 5 → 0 5 6 11 18

Round 3:
Candidate 'private(set)': 13 → 1 2 4 8 12 13 22 25 27 28 29 30 6
Candidate '(set: private)': 11 → 3 10 17 19 20 21 24 26 31 5 18
Candidate 'public private': 8 → 7 9 14 16 23 15 0 11

Round 4:
Candidate 'private(set)': 20 → 1 2 4 8 12 13 22 25 27 28 29 30 6 7 9 14 16 15 0 
11
Candidate '(set: private)': 12 → 3 10 17 19 20 21 24 26 31 5 18 23

And so the consensus result is indeed `private(set)`, much to my surprise.  
Running the count on just voters gave the same end result.

Looking at the comments, there were again a plethora of entirely subjective 
responses supporting, well, everything.  Several people did note that the 
explicit options (that had the word `set` in them somewhere) were better, 
because explicitness, and because it allows them to be abbreviated and/or used 
in an arbitrary order.

We are therefore going to proceed with `public private(set)`, the same syntax 
as Swift and the current RFC text use.

Thank you everyone for your participation.  The results clearly show that not 
everyone is going to be happy with the outcome no matter what, but I hope that 
going through this poll and sharing this level of transparency ensures that at 
least most people feel heard and that their viewpoints were considered.

We'll be back with an updated RFC as previously discussed as soon as Ilija is 
able to make it all work.

--Larry Garfield

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to