Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88831 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57339 invoked from network); 15 Oct 2015 19:32:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Oct 2015 19:32:37 -0000 Authentication-Results: pb1.pair.com header.from=pedronaroga@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pedronaroga@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.177 as permitted sender) X-PHP-List-Original-Sender: pedronaroga@gmail.com X-Host-Fingerprint: 209.85.160.177 mail-yk0-f177.google.com Received: from [209.85.160.177] ([209.85.160.177:36814] helo=mail-yk0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 56/FA-23021-45FFF165 for ; Thu, 15 Oct 2015 15:32:37 -0400 Received: by ykdt21 with SMTP id t21so27536632ykd.3 for ; Thu, 15 Oct 2015 12:32:34 -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=/xCDScE3D2U83In4qdLQXH4DWeWSedWGThH7nrmBLtQ=; b=z0s1I8W5M5GvsikkwYHrRwkr+Wy/jyJzrjkwmmLN9xJi1jVYfYMCQzDz4NdjgJoCHE HCn97+GY2nNBSeKfHJixo/nj5bsjFgc4my4Vh3JzxW6ACPqG96g1SxTnvNO/UBWYkil+ o0p++GfoArBxDYhuYhUlXoQ/AS1W3w472Uldk49MtLIhs8t/wqh6EOcl8FHIKvmPX8Et okX/XkTyBjeLvSzpBUpzUHwUp/FqojAJsEl5iyVCCDUCLUZyd+5SYY+ZfKTo7pO8OTMf mcUQ8cXgN97NRYra0ng89uoPtkHzJx7gv0JpPflYswURt2R6X8fV64sDq0CgoRFyEXoG 58fA== MIME-Version: 1.0 X-Received: by 10.129.156.23 with SMTP id t23mr7844031ywg.151.1444937554325; Thu, 15 Oct 2015 12:32:34 -0700 (PDT) Received: by 10.37.108.195 with HTTP; Thu, 15 Oct 2015 12:32:34 -0700 (PDT) In-Reply-To: References: <561F4EEB.8070605@telia.com> Date: Thu, 15 Oct 2015 16:32:34 -0300 Message-ID: To: Ryan Pallas Cc: Sara Golemon , =?UTF-8?Q?Bj=C3=B6rn_Larsson?= , Sammy Kaye Powers , PHP Internals Content-Type: multipart/alternative; boundary=94eb2c0b8ce8a5f6e6052229bdac Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Revisit trailing commas in function arguments From: pedronaroga@gmail.com (Pedro Cordeiro) --94eb2c0b8ce8a5f6e6052229bdac Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable > Wouldn't this give the same benefit as trailing commas when it comes to > adding removing arguments - a single line diff? It would. However, I see some merit in someone wanting trailing commas for diffs. Leading commas would break away from PSRs and one should not have to choose between a standard or clean reading. If someone chooses to lose their precious time implementing this, it would actually give some people a new feature (clean diffs while keeping PSR2 compliance) without taking anything away from people who oppose this. This is not objectively bad, it just adds an option to the pool, which I think is good. I see no reason to allocate resources to make this happen, but if someone does allocate their personal time into coding this, I wouldn't oppose a merge. But again, I have no vote. 2015-10-15 16:16 GMT-03:00 Ryan Pallas : > On Thu, Oct 15, 2015 at 11:14 AM, Sara Golemon wrote: > > > On Wed, Oct 14, 2015 at 11:59 PM, Bj=C3=B6rn Larsson > > wrote: > > > Given the reason against this RFC in the thread it would be interesti= ng > > > to know why HHVM decided to implement it? > > > > > > > Happy to answer, but I need to state a couple things first: > > * I don't really care if this change lands. I'd kinda like it, but > > it's not solving a massive problem for me. > > * There aren't any compelling reasons against this. The only reason > > given of any note that I've seen is: "There are no compelling reasons > > in favor of it." And I'll agree with that. Like I just said, it's > > not solving any major problems, and it's not going to cause any major > > problems. It's just a tiny, vanishingly insignificant piece of > > syntactic sugar which disappears before we even get to the AST. > > > > So again, could scarcely care less, so don't expect me to champion > > either side, but you asked "why", so here it is: It makes code reviews > > marginally less ugly. > > > > That's it. It's a tiny problem to solve, and likely saves less than > > 100ms during diff reviews, but it's a solution to a problem. > > > > Yes, it's a problem which countless developers live with to no > > significant negative consequence. Solo developers and small shops > > won't care about this since they tend to not bother with code reviews. > > FB has enough engineers working on its very large codebase though, > > that nobody has it all paged in, so code reviews are mandatory, and if > > we can spend five minutes of effort to loosen the parser rules in > > exchange for saving 1/10th of a second on every diff review that > > extends/shrinks a function call/signature with no overhead, then of > > course we would. That's a fair exchange. > > > > Apologies if you were hoping for a compelling reason. > > > > 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? > > function foo( > $bar > ,$baz > ,$boo > ) { ... } > > too_many_args( > $this->id > ,'some constant string' > , 123 > ); > > Wouldn't this give the same benefit as trailing commas when it comes to > adding removing arguments - a single line diff? > --94eb2c0b8ce8a5f6e6052229bdac--