Re: [RFC][DISCUSSION] Revisit trailing commas in function arguments
| From: | Björn Larsson | Date: | Fri, 16 Oct 2015 19:01:52 +0000 |
| Subject: | Re: [RFC][DISCUSSION] Revisit trailing commas in function arguments | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-88859@lists.php.net to get a copy of this message | ||
Den 2015-10-16 kl. 15:09, skrev Sammy Kaye Powers:
On Thu, Oct 15, 2015 at 8:28 PM, Marcio Almada <marcio.web2@gmail.com> wrote:should be split on each case? Like the remove depr. func. RFC: https://wiki.php.net/rfc/remove_deprecated_functionality_in_php7 r//BjörnHi, 2015-10-14 16:25 GMT-03:00 Sammy Kaye Powers <me@sammyk.me>:Hey Márcio! Thanks for the suggesting "trailing comma all the things" idea. I can certainly get behind that idea and I think it would offer an even stronger argument than just trailing commas on function args. I'm curious what others think about broadening the scope of the RFC to include all the list grammars in PHP. Well, if there is a wish to broaden the scope maybe the votingHello internals friends! I'd like to open a discussion on the RFC to allow trailing commas in function arguments. https://wiki.php.net/rfc/revisit-trailing-comma-function-args Discuss! :) Thanks, Sammy Kaye Powers sammyk.meSammy, I think this proposal is too narrow. If we are going to bother to change the language, then let's do it consistently and allow trailing commas on all lists in the grammar. These are the ones on mind right now: - use declarations - group use declarations - function call argument list - class member lists (both constants and properties) - argument list declarations - arrays (already allowed) As exemplified in this gist: https://gist.github.com/marcioAlmada/75f8f1d47da5dcac2e57 Why? Because it prevents a reality where each PHP minor version introduces trailing commas in a new different place, hurting code portability. Because it couldn't get more consistent. And more importantly: because we would get rid of this discussion about trailing commas, forever j/k :) ty, Márcio