Re: [RFC][DISCUSSION] Revisit trailing commas in function arguments

From: Date: Wed, 14 Oct 2015 23:24:32 +0000
Subject: Re: [RFC][DISCUSSION] Revisit trailing commas in function arguments
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-88801@lists.php.net to get a copy of this message
Hey Sammy, Sammy Kaye Powers wrote:
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! :)
Hmm. I'm not sure if this is a good idea. For arrays, trailing commas make perfect sense: arrays are very often written over multiple lines, where trailing commas look pretty, and it's likely new elements will be added or old elements removed, justifying the trailing comma for cleaner diffs and less pain when editing the source. But for functions? Most function calls are just a single line. Most function declarations, too. And even when they are multi-line, you're not going to be adding a new argument or parameter, respectively, very often. Since these additions aren't very common, you'd need to use trailing commas everywhere (yuck) to get any benefit, because you probably can't predict which instances you're going to change soon. To me this looks like something that adds another big stylistic difference to disagree on, and adds potential ugliness (foo($bar,);) for very limited gain. So, my intial reaction would be a -1, sorry. Thanks. -- Andrea Faulds http://ajf.me/

« previous php.internals (#88801) next »