Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80207 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84105 invoked from network); 5 Jan 2015 22:52:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jan 2015 22:52:00 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.174 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.174 mail-pd0-f174.google.com Received: from [209.85.192.174] ([209.85.192.174:33044] helo=mail-pd0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3A/1C-21693-F851BA45 for ; Mon, 05 Jan 2015 17:51:59 -0500 Received: by mail-pd0-f174.google.com with SMTP id fp1so28975604pdb.19 for ; Mon, 05 Jan 2015 14:51:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=Y5RzdB+dIXpjftt06fa3//BXm3xtUBqbsQ8S7l8jPOE=; b=e4H3mrJmqvDtzLL38gOpRf8M0JNqG1Mg7lKRduIM4rVVMZAJkldqeENRrMtvT9S3sC KECFuSAxAYSFQHo4A3gIJh0pRRcmXA3vypCr+DVo1XBe/yTrT3GVtKKWEcry0Q8mdrBR TWhMTMJyns6zYwBPGI5+BKVDw+XkiirYn764v0eTU1RKzCKD8S6NAuOcLHZ/Wg/hmtPv ztUgI+1D2sst+duhSieCUi7QpAAgw29NCltoNva2S8bRgcY59AJsNp1fCTO8QwpId/Xn kylwIdB36rlAAYN8mlhgZTmyCVWMofMRuDRRZq3PbjZPCqjE0FZNZ1VVx2J5pcsQ9hGM K2ww== X-Received: by 10.68.200.36 with SMTP id jp4mr137415673pbc.153.1420498316151; Mon, 05 Jan 2015 14:51:56 -0800 (PST) Received: from stas-air.corp.wikimedia.org (tan4.corp.wikimedia.org. [198.73.209.4]) by mx.google.com with ESMTPSA id od13sm38085766pdb.18.2015.01.05.14.51.55 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Jan 2015 14:51:55 -0800 (PST) Message-ID: <54AB158A.9030000@gmail.com> Date: Mon, 05 Jan 2015 14:51:54 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Andrea Faulds CC: PHP Internals References: <54AB0A10.4010709@gmail.com> <54AB0F3A.5020606@gmail.com> <06711056-CC82-41A6-BED9-FB87450C63BE@ajf.me> In-Reply-To: <06711056-CC82-41A6-BED9-FB87450C63BE@ajf.me> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] Parameter skipping, take 3 From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > Sure, but things like this make such APIs easier to work with. That’s > not a good thing. For me, it is. Your stance is "if it's not ideal (in my opinion) design, we should not do anything to make it better". I think it's wrong - there are many opinions about what ideal design is, and yours has no inherent advantage over others. Removing the existing pain is always good for me, and telling people "rewrite all your code or live with the pain forever" is not a good practical stance. It may feel very purist and satisfying - "here we showed these horrible people how to do things right!" - but practically it is next to useless. PHP has always been a practical and not theory-purist language, and this IMO falls directly in this category. > There are places where optional parameters are good. I never said > they were bad. This RFC doesn’t help with optional parameters, it > helps with excessive numbers of them, or optional parameters with "Excessive" is a matter of opinion. If you have more than one of them, this RFC is helpful. > Well, some of the languages. Others have decided that named > parameters aren’t a good idea. I don't think the majority of PHP users here on your side: http://programmers.stackexchange.com/questions/27564/what-features-would-you-like-to-have-in-php Neither probably would be a majority of Python users. Or Ruby users. Of course, you can say all these people are horrible programmers who know nothing about designing APIs, but I'm afraid if you exclude all these from consideration when you design language features I'll get pretty lonely. > them apart is key. Seeing “NULL, FALSE, FALSE, 0, NULL” may orient > the user better when scanning a parameter list than “default, > default, default, default, default” would. Nobody would use "default, default, default, default" because that's meaningless, you could just not put them in. $foo, default, $bar would be much more frequent case, and that's what it is for. You can, of course, get it to absurd lengths, but so can be done to any feature. -- Stas Malyshev smalyshev@gmail.com