2013/2/22 Rasmus Schultz <ras...@mindplay.dk>

> I've been thinking about this RCF for a while now:
>
> https://wiki.php.net/rfc/trailing-comma-function-args
>
> It just doesn't seem necessary - the only time I've ever found something
> like this to be necessary, is when a function takes closures or other very
> long arguments, some of which are optional...


I must say, that I find this RFC completely useless. In my opinion when one
has such a long parameter list (or too long variable names),
that he must break the call onto several lines, the additional line in the
vcs' diff is the minor problem.


> but actually, writing this in
> a VCS-friendly way is already possible:
>
> $tree->traverse(
>     $tree
>     ,
>     function($node) {
>         // ...
>     }
> );
>
> ... version 2 ...
>
> $tree->traverse(
>     $tree
>     ,
>     function($node) {
>         // ...
>     }
>     ,
>     function($node) {
>         // ...
>     }
> );
>
> This actually comes out more legible, in my opinion.
>
> What really irks me about this patch, is that the trailing comma implies
> that another optional argument may exist - it really doesn't make the code
> more intuitive to read. The example on the page (using fopen) really isn't
> a realistic use-case - who would break a couple of simple arguments into
> individual lines like that?
>

/sign
Especially about the "implies, that another optional argument may exist":
One does not simply add arbitrary arguments to a function call. Except when
the function signature changes, but in this case (to repeat myself) the
additional diff-line is negligible.


>
> Just my two cents...
>

My too


>
> - Rasmus
>



-- 
github.com/KingCrunch

Reply via email to