Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88801 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49750 invoked from network); 14 Oct 2015 23:24:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Oct 2015 23:24:39 -0000 X-Host-Fingerprint: 2.123.167.169 unknown Received: from [2.123.167.169] ([2.123.167.169:13851] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3D/A7-33697-434EE165 for ; Wed, 14 Oct 2015 19:24:37 -0400 Message-ID: <3D.A7.33697.434EE165@pb1.pair.com> To: internals@lists.php.net References: Date: Thu, 15 Oct 2015 00:24:32 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:41.0) Gecko/20100101 Firefox/41.0 SeaMonkey/2.38 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 2.123.167.169 Subject: Re: [RFC][DISCUSSION] Revisit trailing commas in function arguments From: ajf@ajf.me (Andrea Faulds) 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/