On Thu, Oct 15, 2015 at 1:46 PM, Sara Golemon <poll...@php.net> wrote:
> On Thu, Oct 15, 2015 at 12:16 PM, Ryan Pallas <derokor...@gmail.com> > 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?