Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84355 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 575 invoked from network); 5 Mar 2015 20:42:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Mar 2015 20:42:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.181 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.181 mail-wi0-f181.google.com Received: from [209.85.212.181] ([209.85.212.181:38823] helo=mail-wi0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EA/8A-40418-AAFB8F45 for ; Thu, 05 Mar 2015 15:42:18 -0500 Received: by wiwh11 with SMTP id h11so41673695wiw.3 for ; Thu, 05 Mar 2015 12:42:15 -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:subject:references :in-reply-to:content-type; bh=Pm7PVAOwFnWOMQdWLerHJJwJ4GdoihtF2etzw6WiAow=; b=IBYCvTyKSGWz+VUjMI+BT+YUkOEsfrHRNQOOwkSPKUWZcxBoENGObo2HbuVcNlTim8 5sFRdZvnjyhk7mfxavQSMufBY9L+lDTYyQmWQsWHD26MaGgezSpVW8Vyqc5R9dSpZ88k cjiCQMx08vSQQF4jTY3S1CSP2b+SaVSrv9VF1J0Xjid4+rBUiZUP2ca8m6bc7zVLJcde DmDT7YgCwB1BhEIx08FSFwwN9CrfhndlX30ZCzB8LabyOEjutqC1JJlGP4c8X0umErYo Xl447EL0nVQu4eIkXKCM8VO3IZTaM76cSVdu2pKAVqDkF5AmM7O3D6A0KSGNbVZ/KIlE +XeA== X-Received: by 10.194.60.203 with SMTP id j11mr22779803wjr.5.1425588135540; Thu, 05 Mar 2015 12:42:15 -0800 (PST) Received: from [192.168.0.159] ([62.189.198.114]) by mx.google.com with ESMTPSA id m4sm12034916wjb.25.2015.03.05.12.42.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Mar 2015 12:42:14 -0800 (PST) Message-ID: <54F8BF67.6080600@gmail.com> Date: Thu, 05 Mar 2015 20:41:11 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: "internals@lists.php.net" References: <54F4FDFB.8010701@lsces.co.uk> <54F5895D.3090002@gmail.com> <554F0C3F-770F-4694-A5AB-FDC54FCCBF00@gmail.com> <1FCB68B8-3E55-4B5D-B805-9D92D848A3A1@gmail.com> <5D8591E2-5AE6-4B4C-AAE0-3D15523410AC@gmail.com> <54F83C4D.1020206@gmail.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------040901090906060902020001" Subject: Re: [PHP-DEV] Consistent function names From: rowan.collins@gmail.com (Rowan Collins) --------------040901090906060902020001 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Yasuo Ohgaki wrote on 05/03/2015 20:20: > Hi Arvids, > > On Thu, Mar 5, 2015 at 9:32 PM, Arvids Godjuks > > wrote: > > 2015-03-05 13:49 GMT+02:00 Pierre Joye >: > > > > > > I will say it again a last time, in my opinion only a clean API; > > object-like or real object as long as performance is not affected is > > the only way I could see to actually solve this problem. > > > > Changing the names, argument order (pointless once we will have > named > > arguments, btw) and similar solutions are band aids solutions, > > confusing at best, terrible at worst. It is pointless to do it after > > almost two decades for some of them. > > > > -- > > Pierre > > > > I'm with Pierre here. > Adding aliases is gonna mess up things even more. For example - > autocomplete will become hard to navigate. It's already quite > lengthy list > a lot of the times and it's easier just to write the whole > function name > sometimes by hand. Adding aliases will make it worse. > > > I agree. Therefore, I'm going to update manual also so that it recommends > main function, not aliases. Aliases should be alternative. > > Manual and IDE don't have to list all of them. New manual lists only main > functions, does not have dedicated pages for aliases but aliases are > mentioned > in main function page as aliases. You can't fix everyone's IDEs for them. You can't fix all the documentation (tutorials, blogs, Q&As) not hosted on php.net. Most of all, you can't fix the thousands of projects already written in PHP using the "wrong" function names, most of which will want to *continue* using those function names, because that will be internally consistent, and portable between versions. The problems people are pointing out are not ones that you can promise to fix. > > We really need a new API, that is not crossing paths with the old. > That way > people can start building stuff on new API's and we could phase > out the old > mess, for example: depricate in PHP8, remove in PHP9. > Stop-gap measures have created enough problems already, or did > everyone > suddenly got an amnesia and forgot all the past lessons on the list? > > > PHP should be multi paradigm language, not pure OO language. > IMO. Python does good job. The paragraph you are replying to says "new API". It does not say "pure OO". As I've said before, the relevance of scalar methods is not that objects are cool and functions are boring; it's that they're something new we can design from scratch without worrying about the 20 years of legacy the existing API has. > I finally understand why some of us against this change and suggest OO > APIs > as alternative. It's reasonable making procedural APIs a > legacy/unmaintained/ > messed up to discard procedural APIs someday. I'm against it. PHP should > be like Python in this regard. IMO. OK, so let's look at our options to maintain the language as multi-paradigm: 1) Implement piecemeal tweaks to the current API, adding to the confusion of users, in the hope that eventually we accumulate enough fixes, everyone gets used to them, the old ones die away somehow, and the result is a slightly nicer set of functions, with various awkward compromises along the way. 2) Find a way of designing a clean-break new API which is still procedural. More than just a namespace, which is basically just some new names with \ in; and definitely not something where the same code can mean a different thing depending on a setting or import at the top of the file. Something which will feel fresh, which users will want to start using, and will recognise when they see code using it. I don't what that might look like, but if you have some ideas, that is how you will move this discussion forward, with a radical new solution; everything you have said so far are things which have been said over and over again before. Come up with something which nobody has thought of before, or take our word for it that everyone who has previously proposed this has failed. Regards, -- Rowan Collins [IMSoP] --------------040901090906060902020001--