Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114968 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 64622 invoked from network); 18 Jun 2021 23:23:56 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 Jun 2021 23:23:57 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9E0CA1804CC for ; Fri, 18 Jun 2021 16:41:16 -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.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 16:41:16 -0700 (PDT) Received: by mail-wm1-f53.google.com with SMTP id l18-20020a1ced120000b029014c1adff1edso9630113wmh.4 for ; Fri, 18 Jun 2021 16:41:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beberlei-de.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NzRMmXyO8CTudj2nf04a1+OqiILWBy3s46htFUifeRE=; b=h2hCezfFe0DZbpg0QOo2GxEIqaJXWPSSwXTqnsAR+IJ+nyXZbyKyxdehLqk7ieDETf aD5/ojHbS2U//Llb9bvkpHOOjuAGcI5JzSlxx/c6BN8TUiteWQbYXPPg6/NBivr7IYI0 MnRTQ0wYvD2jMybfMq+8uB5PSXWzOZTGhuCsWkDqomNcsAQRPlqDKTmnltlYxYBLth12 of/nTbK/WFZfVIZtmaInv41Zn64TgKEAYtoKRCgrtA1lXyUv7ry+4NqpMcH60zVYeqC7 aPtT6RKZFGAS/ZtDxh88LiboFYlC+p72fRI/4dYhQMMuyXMl1kNmas5cPKKrtMV5TOis /MiA== 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=NzRMmXyO8CTudj2nf04a1+OqiILWBy3s46htFUifeRE=; b=mFyV/vatIr/dYtte0LMFZG/IEgbtpA4yEIAkWJ7GQVd+3fMlj90L6SUEPP0Nrj3p4Z YJBglsbvcKaHEZgxeieUeBI5wbJOF9AjpcrA03SbyF9wQ+x1jnhk1DJuuz6vdjh22v1u PJJSDE68fUlp0stT5sz2SAfiKTYz7cPeF7kzAlj4uNNdAy6AQovYMCoeMkDhiC59tE8l 2+eJvnOhU77uZRKX3E1urgAY5Ip47ZReZTEUCj97kmNFwmm6CvGA2hrXFFXJkPd7bgHt 22GdMBbLgAsxuAaPrsppPEVjPfRSL4YpbT0Aj+J5g4GBzWJ0OKReqtJDgK/j192eamGw mFjg== X-Gm-Message-State: AOAM531jaQC4TK0jkc3YpF3GzCtdD4VJPZ41w34zqnIoVzcwFLzbeoxE D/vVbVGQrWVXpkHhyrdCY00h4HupyE8GkCgZUqwTqBLdYArkYA== X-Google-Smtp-Source: ABdhPJwVoT9zRJ/yevvJNhiv2gFgSdI+xXsB6Riyk9OENmviAYDV3uA16AdBqfLY/881DchyPiaLJ34FU/BqUeJCMDI= X-Received: by 2002:a05:600c:4b88:: with SMTP id e8mr13523551wmp.107.1624059674653; Fri, 18 Jun 2021 16:41:14 -0700 (PDT) MIME-Version: 1.0 References: <222b3921-3d9b-47f9-8d13-e6a123f36fad@www.fastmail.com> In-Reply-To: <222b3921-3d9b-47f9-8d13-e6a123f36fad@www.fastmail.com> Date: Sat, 19 Jun 2021 01:41:03 +0200 Message-ID: To: Larry Garfield Cc: php internals Content-Type: multipart/alternative; boundary="00000000000000851905c512dcbe" Subject: Re: [PHP-DEV] [Vote] Partial Function Application From: kontakt@beberlei.de (Benjamin Eberlei) --00000000000000851905c512dcbe Content-Type: text/plain; charset="UTF-8" On Wed, Jun 16, 2021 at 6:17 PM Larry Garfield wrote: > Hi folks. The vote for the Partial Function Application RFC is now open, > 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 that, > as Nikita explained off-list it was actually more confusing, not less, as > it would suggest "placeholder for a variadic" rather than "a placeholder > that is variadic." Otherwise, it's just more typing. The syntax choices > 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 using 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 delayed 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 the 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 proposes to do a thing (calling functions) in a completly new way that will be hard for beginners. I hope we don't add both these features to keep the language smaller in this aspect of how functions are called. > -- > Larry Garfield > larry@garfieldtech.com > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > --00000000000000851905c512dcbe--