Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88837 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66467 invoked from network); 15 Oct 2015 19:51:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Oct 2015 19:51:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=derokorian@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=derokorian@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.178 as permitted sender) X-PHP-List-Original-Sender: derokorian@gmail.com X-Host-Fingerprint: 209.85.217.178 mail-lb0-f178.google.com Received: from [209.85.217.178] ([209.85.217.178:33861] helo=mail-lb0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 44/0D-23021-0C300265 for ; Thu, 15 Oct 2015 15:51:29 -0400 Received: by lbbwb3 with SMTP id wb3so21170177lbb.1 for ; Thu, 15 Oct 2015 12:51:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=3IkYdNKX1ZTQLpUr2b53iAdRzbd10GReCdO0KjuaTsU=; b=XYzyvsV2V04WH1RIoqbt6h8CSmvPHzZnqnXhLZDHe0/p5fIFsSmUt+W1IDPEySA81q VG1UGuWwAleZ34I2vDf/03xMCj58iosN6oziurdrT3Wy03GjFhzIfLOxafieIIzSlzUi 6WGjWrWe+vEDk0fmOSCXba+NSnqV436wM20rQ5ME1+p0duevDheVk6NzOWodHJC5N64x Aba6HAImXHARCoaMqlSbRhJDNRxTUsNf5Y+7hNJxqIU54P5hWoqS728r8O2Pq81LoKwl dqa4wgDvndYWpTEvT8Eg3705+caqW0ivUPAErCL1QvoGvVRDgs16VGdYVVEcDzZ/P1Ih tyvQ== MIME-Version: 1.0 X-Received: by 10.194.8.227 with SMTP id u3mr12686784wja.38.1444938685120; Thu, 15 Oct 2015 12:51:25 -0700 (PDT) Received: by 10.28.143.137 with HTTP; Thu, 15 Oct 2015 12:51:25 -0700 (PDT) In-Reply-To: References: <561F4EEB.8070605@telia.com> Date: Thu, 15 Oct 2015 13:51:25 -0600 Message-ID: To: Sara Golemon Cc: =?UTF-8?Q?Bj=C3=B6rn_Larsson?= , Sammy Kaye Powers , PHP Internals Content-Type: multipart/alternative; boundary=047d7b5d9c070c8a0c05222a010a Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Revisit trailing commas in function arguments From: derokorian@gmail.com (Ryan Pallas) --047d7b5d9c070c8a0c05222a010a Content-Type: text/plain; charset=UTF-8 On Thu, Oct 15, 2015 at 1:46 PM, Sara Golemon wrote: > On Thu, Oct 15, 2015 at 12:16 PM, Ryan Pallas > wrote: > > But its an entirely stylistic choice to use trailing commas for cleaner > > diffs. You could also use leading commas as well. If you made that a > coding > > standard for the organization, you would not have needed to implement > > trailing am I right? > > > > Wouldn't this give the same benefit as trailing commas when it comes to > > adding removing arguments - a single line diff? > > > IMO, that would solve the one small problem in exchange for a new > small problem. That of the cognitive overhead of parsing leading > commas where standard practice calls for trailing commas. > > And before you counter than the final optional comma also comes with > overhead, let me point out that the array consistency argument. We > have trailing commas there already, so no new mental overhead. > > Wasn't planning on countering, just trying to show that Hack made a conscious choice to go this way. I personally don't see a benefit, as its not hard to read a diff that has a new comma on a previous line following by a new var/value on the next - but if people do then by all means add it in :) I do h ave one question I just thought of though... how does the allowance of trailing comma work with the splat operator (...)? I'm assuming a function call/definition may only have one or the other, is that correct? --047d7b5d9c070c8a0c05222a010a--