Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66165 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24855 invoked from network); 22 Feb 2013 21:47:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Feb 2013 21:47:14 -0000 Authentication-Results: pb1.pair.com smtp.mail=krebs.seb@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=krebs.seb@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.171 as permitted sender) X-PHP-List-Original-Sender: krebs.seb@gmail.com X-Host-Fingerprint: 209.85.212.171 mail-wi0-f171.google.com Received: from [209.85.212.171] ([209.85.212.171:52927] helo=mail-wi0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3A/16-26685-167E7215 for ; Fri, 22 Feb 2013 16:47:14 -0500 Received: by mail-wi0-f171.google.com with SMTP id hn17so1482133wib.4 for ; Fri, 22 Feb 2013 13:47:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=mq5GjvW7UwKOdk3lutid3Mhb8Qsf6T2CSx1Ale76Uyg=; b=d4SWNW11fmd5ex7xcQwM5keZypGsIcjWIHF1uBvcC0zD1IQbRmb4vdCLNLO5ThF9F1 /xCHth7wjym6Yn//aZxOZTdUuVnGRxGJPexMZc38xXNgs1W1Q1z9dAyGqyBfiNYZ58U6 E4GXPXcXnKN5olr7QPtWtSvZh9qqXIy+sJWV6YDowAytKYJbwjrMUYeyKYktB28iswmt tOeQefnV1mgD/OrP+fPxjiMddR+yYYw2X71pxgRoyuYeYa39vlGLuBMXQ9pBWLn4pdiY kRsU+mHQXaeBO6zrbkw588VEtqOThfysTQ2Jycksv+Km1xqeuVt05YX4GcGldolwnZzD RTtQ== X-Received: by 10.194.110.69 with SMTP id hy5mr6448019wjb.1.1361569631029; Fri, 22 Feb 2013 13:47:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.98.197 with HTTP; Fri, 22 Feb 2013 13:46:49 -0800 (PST) In-Reply-To: References: Date: Fri, 22 Feb 2013 22:46:49 +0100 Message-ID: To: Rasmus Schultz Cc: PHP internals Content-Type: multipart/alternative; boundary=089e010d867a31c9d404d657226b Subject: Re: [PHP-DEV] rfc:trailing-comma-function-args From: krebs.seb@gmail.com (Sebastian Krebs) --089e010d867a31c9d404d657226b Content-Type: text/plain; charset=ISO-8859-1 2013/2/22 Rasmus Schultz > 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 --089e010d867a31c9d404d657226b--