On 20/02/2013, at 10:47 PM, Alain Williams <a...@phcomp.co.uk> wrote:
> On Wed, Feb 20, 2013 at 03:26:26AM -0800, Sara Golemon wrote: >> On Tue, Feb 19, 2013 at 4:06 AM, Sara Golemon <poll...@php.net> wrote: >>> Opening RFC to allow trailing comma in function call argument lists >>> >>> https://wiki.php.net/rfc/trailing-comma-function-args >> For the record, I've updated the RFC just now to include >> function/method/closure declarations as well: >> >> function foo( >> $bar, >> $baz, >> ) { >> >> } >> >> Not a pattern I see as much, but for the sake of consistency, it >> doesn't hurt to put it on the table for discussion. > > I would argue against the RFC. > > The trailing comma is useful with arrays since it is not uncommon that members > need to be added to an array over time. This is often as a result of changes > outside of the program (eg: another user added to an ACL). Such a change does > not alter the purpose or functionality that is represented by the array, it > just > does it for more somethings (users in my example). > > Much source/version control is line based and so trailing commas helps keep > differences short. > > With functions: I do not see arguments being added in the same way, ie you are > getting the function to do more of the same by adding an extra argument. If an > extra argument is added it is because what the function does has changed in > some way. > This is very different from the just-a-bit-more scenario that you have with > arrays. > > If a function has a list of arguments that is expected to change, many > programmers would do that by passing an array to the function and arrays can > already have trailing commands .... > > Also: many other languages (eg C, Perl) allow a trailing comma in arrays, but > not to function arguments. This change would make PHP different from what many > programmers might expect. > > -- > Alain Williams > Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT > Lecturer. > +44 (0) 787 668 0256 http://www.phcomp.co.uk/ > Parliament Hill Computers Ltd. Registration Information: > http://www.phcomp.co.uk/contact.php > #include <std_disclaimer.h> > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > The one place I would find this to be super handy would be when specifying arguments to sprintf(), and other variable argument functions. Cheers, David -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php