Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114721 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 22757 invoked from network); 3 Jun 2021 21:53:51 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Jun 2021 21:53:51 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 195201804CC for ; Thu, 3 Jun 2021 15:07:25 -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.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (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 ; Thu, 3 Jun 2021 15:07:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1622758042; bh=SZs0b7T7ra9vZ2bfp69ZBm9sa/j06exbHr27Hya9M6Q=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=Z4YMJL5smDLRd0SJoLzIniNeP2FAinEVrm4amEyDQLjacwNzUMoFbp1yAqrwjUbMH VWQ3oqVHAGktUfdWWTdwCKTDettMKKyg6rssTztugI70ZZM2FdQYGoC2rQwZia9h5Z x5VpaOaocdfmaozX+5RP8HHUmkVPZ/yyWElrD/zE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.2.130] ([84.179.239.173]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mkpex-1l6Hsz0W91-00mNbN; Fri, 04 Jun 2021 00:07:22 +0200 To: Mel Dafert , internals@lists.php.net References: <6D61A2FD-DC80-43A5-81C2-FB19F9CB5078@dafert.at> Message-ID: Date: Fri, 4 Jun 2021 00:07:21 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <6D61A2FD-DC80-43A5-81C2-FB19F9CB5078@dafert.at> Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:UDs04GCPPnE0fR2kDkqAyHiOD1fGMs47l0ITBCEgUfYGFHD5AjH lWUKd0Tfb3pQIZDAMEFvAhiNCJ2O2N5Z9VAiRjU5I+wcLUNDwVfV1O0ZRny9Ntgka6l4IZ/ 7+cSc29t+kMGru9QJzMq2sKvNRdWeQg+bPHCfHd57Vrm2Vgyb+EJgj53PzitU/MMB9XMJR8 91fN1UYEr4xgy7hPbcvLw== X-UI-Out-Filterresults: notjunk:1;V03:K0:21gEO5fXy0o=:4at6gijIw7OWIvWiCQHt4K FrZPk0l6rPzT2xbaiIzGYzmvKY0V7Eag7Q8VsO7Bw0/9JSgTqAY+1+GatCb8UcxJ7kaKDVrXJ kDSDvJfsaKBiGdQB9y/9i7DzBToBj1OPc5fTLXwCzJfQ1yrrhE5o0ax9icswTxDjQQw+ZgRtw 23csMjzesqrN+nWZZXErQPVj3rPyuPB3DUmiBVEGO2QhBaIZt26XDiVxYQtP6Ikaw1IV3ZpHG MjY28J9QsoGKw0MailgRYwP4/OeexDQuGiwUUqyi2Dj0kjvA3hfZ5hwBxMGVz0TqRixGcbb9v aioAQi843xWnqJ86qBdMpxviGEA3svvRatahVJMgEDsXHu0ualBUVoaKG00QtKnl83BIA84Fm oPjZmJX8o8M8TAJuXiafoIz/+3rWmsRTYS4964M2aARDePUgj6CBu7+xGxEoreVZzT80fm8t/ A488ul6WngET/Pn3frVmeMAYWDAiGjKuQC5HUR9w8nknkb/wc44WiXdiCrQa/REQT3ylCqDuy HCUIjSLPR6QLXoP2PeLGrW5ruo8KG+292SsZjA/yQmIjyq9oCALaKqWr3sNNe6gofW9IQDxCW yVviZl46GvFnjogN8e0sQr90owOTPUm9QEoDvyFbzN+W/YEYxu3gitArxFhK8DYH+uWCKc/0M k4CscnMdkNypf2IApw2md3kNDOSGZvBwa4WkXZfaiTRFSBW94XGeCehqpHxm55dklgLZ7vDgn 7zdZJjlzvYkEDMgeu470+acVIhWCLjUTwNRVNvL+FRsvbSgfGtQF13yK1riApI2i9qwqaFmoS jrFb/VQsKIKz/k16BIsARyKpIkutun9Tcr3S+W1Q9xRQ+rK9NjceipuKxAX4V7GaYrKqc+yEO 0sw2NcpbNCI7bdGOe5oJwGqI29lzoGyKppwMftsD+ZZj4Nn7a/spYszjr9gctXurB4HPsD+6y Hd9eZglqm9VPPWWbV2jSIkI4aybW/sCgO2W5ROxpzFImrrQ78MbbxAvbDaEApHmIFrbbA0ijs ubyhh0aA3rEr3I3Kwvg7TVr4cC7UAiZngKE94XYBjC5g1+vhfMCwd6FswU2Ha0LM1D4tbCg0n v6wLsH1cv1Y1+Bo5P1WnKSvKbx/YRHXlisw Subject: Re: Policy for procedural style in new additions From: cmbecker69@gmx.de ("Christoph M. Becker") On 03.06.2021 at 20:28, Mel Dafert wrote: > After the RFC to add IntlDatePatternGenerator () was accepted, it was br= ought up that the duplication of > procedural and OO style was not necessarily/useful anymore. > This already has some (old) precedent - in 2012, UConverter was added to= ext/intl > (https://wiki.php.net/rfc/uconverter) and in 2014 IntlChar > (https://wiki.php.net/rfc/intl.char) - both of which only provide a clas= s, but not the > procedural API. > This was also shortly discussed on the mailing list for IntlChar: > https://externals.io/message/79146#79167 after which the procedural API > was dropped without much ado. > > When I wrote the IntlDatePatternGenerator RFC, I was not aware that the > procedural API was viewed as deprecated, nor that there had been additio= ns to > ext/intl that were purely OO. > In the thread after its vote, it was also suggested that we add a policy= that > forbids new additions from adding duplicated APIs, and that OO style sho= uld > be preferred if possible. I am not sure if I am the best person to write= such an RFC, > but I wanted to bring this to its own thread and provide the context I h= ave dug up so > far. > > The duplication of the OO and procedural API dates back to the addition = of the intl > extension to core. There is some discussion about it in this thread from= 2008: > https://externals.io/message/36775 > (ignore the unrelated discussion about PHP6) > The main argument at this point was that OO in PHP is a new thing, and t= hat while > the OO API is objectively better, the procedural API should also be ther= e to > lessen the learning curve for existing PHP users that are not yet famili= ar with OOP. > I would argue that 13 years later, this argument no longer holds - anyon= e who > has used PHP at some point since then most likely has encountered classe= s. > > One open question that still remains is what we do with the already exis= ting > procedural API. > Should it be deprecated? Should it only be soft-deprecated, in that we m= ention in the > documentation that the OO style is preferred, but that the procedural AP= I is > not planned to be removed? > Should we just leave the procedural API as-is and live with the fact tha= t some > classes have procedural counterparts > and some don't? > I would personally lean towards (at least soft-) deprecation just for co= nsistency, > but I would like to hear what you would have to say. I'd take a step at a time, and start with "prohibit introduction of new dual APIs" only. (Soft-)deprecation can follow in own RFCs, maybe for single extensions, or even single (groups of) functions. =2D- Christoph M. Becker