Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80210 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89035 invoked from network); 5 Jan 2015 23:14:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jan 2015 23:14:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=marcio.web2@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=marcio.web2@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.44 as permitted sender) X-PHP-List-Original-Sender: marcio.web2@gmail.com X-Host-Fingerprint: 209.85.215.44 mail-la0-f44.google.com Received: from [209.85.215.44] ([209.85.215.44:45855] helo=mail-la0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F7/2D-21693-6DA1BA45 for ; Mon, 05 Jan 2015 18:14:31 -0500 Received: by mail-la0-f44.google.com with SMTP id gd6so19352535lab.17 for ; Mon, 05 Jan 2015 15:14:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=9YZoDTZkoIxoducoUOBL42L6bdQuWu13om4W3tXtTy8=; b=LgZxzUn9mbkc2NQSF0oOUWmaX6BKPEF8jNg9IL1WiPtqRWNKz8nrj4DdqEIgP38QPP hpoVv3sOzw48VnB2TpBKPOeBFqj/QK2PLIZzlCR3Xfhmr8+ejXrSh/1VLUT8ll0XLfwn LQHtMgdm62o94370Z4lAGfNYTnJAGuCDOP2Yq4HZBJB9HuCq8qv3lWNni0ZlAm0e0DXF ue1QEk+PJum1ILA/1XL3IQNi60PQOaVDn+rL6mTughchBtr27JAjRj9ac/qGKiHe9qnk T2IVw1jhNcMsHSUiWw7n6qJkJSLh1Nnibbmax6+sHSZ+/zmu0znZZAQcPbs+xBgFPM0r 0caw== X-Received: by 10.112.52.229 with SMTP id w5mr83031728lbo.52.1420499666563; Mon, 05 Jan 2015 15:14:26 -0800 (PST) MIME-Version: 1.0 Received: by 10.152.21.101 with HTTP; Mon, 5 Jan 2015 15:14:06 -0800 (PST) Reply-To: marcio3w@gmail.com In-Reply-To: <54AB158A.9030000@gmail.com> References: <54AB0A10.4010709@gmail.com> <54AB0F3A.5020606@gmail.com> <06711056-CC82-41A6-BED9-FB87450C63BE@ajf.me> <54AB158A.9030000@gmail.com> Date: Mon, 5 Jan 2015 20:14:06 -0300 Message-ID: To: Stanislav Malyshev Cc: Andrea Faulds , PHP Internals Content-Type: multipart/alternative; boundary=001a1133d3760778ed050befdac1 Subject: Re: [PHP-DEV] [RFC] Parameter skipping, take 3 From: marcio.web2@gmail.com (Marcio Almada) --001a1133d3760778ed050befdac1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, Stanislav, great RFC. A huge part of core PHP API would benefit of parameter skipping. Andrea Faulds, > It=E2=80=99s not that I don=E2=80=99t need this=E2=80=A6 there are some h= orrible APIs I=E2=80=99ve used which would be slightly (but only slightly) more pleasant to use with this feature. But I don=E2=80=99t think we should add features to the language t= o work around poor API design. We should get better APIs instead. Not sure how this RFC rant is helpful since it's based on completely unreal alternatives. This "We should get better APIs instead" suggestion, in practice, means a ton of BC breaks that will never happen on PHP global functions for obvious reasons. 2015-01-05 19:51 GMT-03:00 Stanislav Malyshev : > Hi! > > > Sure, but things like this make such APIs easier to work with. That=E2= =80=99s > > 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=E2=80=99t 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=E2=80=99t 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 =E2=80=9CNULL, FALSE, FALSE, 0, NULL=E2=80=9D= may orient > > the user better when scanning a parameter list than =E2=80=9Cdefault, > > default, default, default, default=E2=80=9D 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 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001a1133d3760778ed050befdac1--