On 27.01.2017 at 17:05, Sammy Kaye Powers wrote:

> After a 2 week (ahem... 1 year & 3 month - sorry for dropping the
> ball) discussion period, the "Trailing commas in all list syntax" RFC
> is now open for voting.
> 
> See the discussion here:
> https://www.mail-archive.com/internals@lists.php.net/msg81366.html
> 
> You can vote yay or nay for each possible list syntax individually.
> 
> Voting will close 2017-02-10 16:00 (UTC).
> 
> Thanks to @WesNetmo for pushing me to bring this to vote. The
> community (or at least a sample from twitter) seems to want this
> (https://twitter.com/sammyk/status/824298464456691712) so here we go!
> :)

Generally, I don't like these trailing commas, but indeed there is some
value for lists that often have to be split across multiple lines.  As
such, my threshold is whether splitting certain lists across multiple
lines is sensible.  In my opinion, the following lists should usually be
one-liners (because having too many items in the list would be a general
design issue):

* function/method *parameters*
* interface implementations on a class
* trait implementations on a class
* class member list (I prefer a distinct statement for each member)
* inheriting variables from the parent scope in anonymous functions

An improvement might be allowing trailing commas in grouped namespaces,
but I haven't enough experience with these to form an opinion.

The only other case where allowing trailing commas would make sense, in
my opinion, are function/methods *arguments* – there is, unfortunately
for me, no explicit voting option.

-- 
Christoph M. Becker

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

Reply via email to