Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114969 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 67755 invoked from network); 18 Jun 2021 23:58:47 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 Jun 2021 23:58:47 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5260D1804C8 for ; Fri, 18 Jun 2021 17:16:10 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-vs1-f45.google.com (mail-vs1-f45.google.com [209.85.217.45]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 18 Jun 2021 17:16:09 -0700 (PDT) Received: by mail-vs1-f45.google.com with SMTP id 68so5888432vsu.6 for ; Fri, 18 Jun 2021 17:16:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tzU3V5hCD0wQ9LJ2PKnCsyeLe1b+7hjlgtqHDlMxRxU=; b=YYI8VFoKyWkeL3PTK+RyJNkFYLyV+4lGyuGBmcahHmr08f2x70E0HGpCJ04/8YRXTv tqpTz6fyJhvEMdudszEaJGpzXZf4WgpyPrbKNNX90H+SB3imcIgEwbR4wqIWMaB3Pv1g 0zdn4Nzk8Pplx5u50lC+Kz/aCzEzNVIYI+BhPNDlw5dZU8wVrWkg3UeZttiKGYxF2x/+ tEO+iP2JUIc2HtS8Z8PAFJ/DkJhClbNXQRUMW+YPQHezU+PkMnpWDsOzFvK0B6ApjtPj kY7P3EtLurRnZYsvqounBnHZHSjFnq02KSVzdTs8mlpDt7bX2tY4TRVpQEcRpuTNT6mI bwRw== X-Gm-Message-State: AOAM533PDzK31CtbsKz5NV3aqJKNYi9SciV2CIMuX7ewI67HqWblvfZD UKTFWnijx/rM5d3++BQjnaM+jotoAChNZW+t5A== X-Google-Smtp-Source: ABdhPJxGCkxT/MwAA3o8pV8m4qq6I6J//ozfyNcE+4jcirIqOFXhgmTR85PMMhOonaHXW+e+qwS02feUk5j9Lsg/NmA= X-Received: by 2002:a05:6102:67a:: with SMTP id z26mr10128531vsf.10.1624061765942; Fri, 18 Jun 2021 17:16:05 -0700 (PDT) MIME-Version: 1.0 References: <222b3921-3d9b-47f9-8d13-e6a123f36fad@www.fastmail.com> In-Reply-To: Date: Sat, 19 Jun 2021 02:15:54 +0200 Message-ID: To: Benjamin Eberlei Cc: Larry Garfield , php internals Content-Type: multipart/alternative; boundary="000000000000a700a505c5135804" Subject: Re: [PHP-DEV] [Vote] Partial Function Application From: patrickallaert@php.net (Patrick ALLAERT) --000000000000a700a505c5135804 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Le sam. 19 juin 2021 =C3=A0 01:41, Benjamin Eberlei a =C3=A9crit : > On Wed, Jun 16, 2021 at 6:17 PM Larry Garfield > wrote: > > > Hi folks. The vote for the Partial Function Application RFC is now ope= n, > > and will run until 30 June. > > > > https://wiki.php.net/rfc/partial_function_application > > > > Of particular note, a few people had asked about using ...? instead of > ... > > for the variadic placeholder. In the end we decided not to explore tha= t, > > as Nikita explained off-list it was actually more confusing, not less, = as > > it would suggest "placeholder for a variadic" rather than "a placeholde= r > > that is variadic." Otherwise, it's just more typing. The syntax choic= es > > section of the RFC has been updated accordingly. > > > > I wanted to explain my no vote on this one. > > The examples section shows how every use-case of partials can be done usi= ng > short functions and while this is often a lot more to type (especially if > you mirror the typehints), these extra symbols feel necessary from my POV > to make the code clear that creates a partial. > > Especially the ... as "additional" arguments and its various interactions > with ? produce so many different ways of calling something, it feels > unnecessary to me to introduce this complexity to newbies that might come > across use of this functionality. Plus the additional edge cases of delay= ed > execution, non-support for named parameters. Its a lot to know to fully > understand this feature. > > Given that the functional paradigm isn't widely spread in use across PHP > developers, i am not convinced that we should add more features in this > direction that increase the complexity of understanding the language by > that much. While one could argue that functional paradigm isn't > wide-spread, because these features are missing, it is my believe that th= e > majority of PHP developers would still rather prefer imperative coding. > > As a thought experiment I tried to think of code in our codebase that we > could convert to PFA once we migrated to 8.1 and there just isn't that > much. This is very different to short functions, nullabilty operator and > other "glue" / sugar proposals that were added to the language lately, > which a lot of existing code benefits from and existing code could be > converted automatically to them using phpcs/phpcbf rules. > > I also am wary of the future after this RFC, as it states it is the > launching pad to another attempt at the Pipe Operator, which also propose= s > to do a thing (calling functions) in a completly new way that will be har= d > for beginners. I hope we don't add both these features to keep the langua= ge > smaller in this aspect of how functions are called. > I second Benjamin's opinion, hence my choice of voting "no" as well. Every new feature we add adds an extra layer of complexity in an exponential way, next new features/syntax have to deal with existing ones. The problem being solved with PFA, including how frequent it could be useful in PHP's ecosystem, does not, IMHO, counterbalance with the increased code complexity. -Patrick --000000000000a700a505c5135804--