Bonesnap wrote:I see, so it's used for when you don't have access to the actual source code?
No, bradgrafelman's example is concerned with an automated edit made to say, a configuration file written in PHP.
Bonesnap wrote:I'm confused, because can't you just add another comma if you're going to add additional elements to the array?
You could.
Bonesnap wrote:Just seems trivial to me. I mean, if you're already there modifying the source code, just make sure there's another comma. shrug
Consider this style:
$x = array(
'hello',
'world'
);
It is conceivable that a maintainer may forget to add the comma:
$x = array(
'hello',
'world'
'Bonesnap'
);
whereas this would be more consistent and such a mistake would be less likely:
$x = array(
'hello',
'world',
'Bonesnap',
);
But if you were writing this instead:
$x = array('hello', 'world');
then such a trailing comma probably makes less sense.