Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84327 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99781 invoked from network); 5 Mar 2015 08:52:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Mar 2015 08:52:45 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; 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:39176] helo=mail-wi0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3F/F5-56703-95918F45 for ; Thu, 05 Mar 2015 03:52:42 -0500 Received: by wiwl15 with SMTP id l15so1262394wiw.4 for ; Thu, 05 Mar 2015 00:52:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type:subject:from:date:to:cc :message-id; bh=mqTJIFoyvo1zO/4DGr73ZW8Ods52aCGQz5viKGSSHcc=; b=REUfpRHMQhbmTVMn+7xh6MHFoZb/YZQSZhOBSfvllQPdJi5WNowtFqSRcEny7qQC/g /ynluAzyexaLXUI1sZeq/M39/fJrylgVLt+WDiNKTFH6/NHz24L5E7J4u63yGynFkbYG IUf7T9AgiKitj/xW/OzsdxpTP+HdthMOsJIn6FlqDVH66OK+O7IJgVHRVQCT8JEhEkew N8H/LQwAkZle8XCaKSfziX6fItejR8xUHchy8Pm2LF3x8iONR8kMzyKs1AcwCVUR6yMN rDvyEMnuRmQc0lc79xCGw0O2Ioa94YoweYryp5YY0A+bQcy1dqfudpJLjl6NjEj72ZaT odYQ== X-Received: by 10.180.85.39 with SMTP id e7mr20117590wiz.90.1425545559072; Thu, 05 Mar 2015 00:52:39 -0800 (PST) Received: from [192.168.0.2] (cpc68956-brig15-2-0-cust215.3-3.cable.virginm.net. [82.6.24.216]) by mx.google.com with ESMTPSA id hi6sm9492196wjc.34.2015.03.05.00.52.37 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Mar 2015 00:52:38 -0800 (PST) User-Agent: K-9 Mail for Android In-Reply-To: References: <54F4E29D.7080501@garfieldtech.com> <54F4E93C.80206@gmail.com> <54F4EBEC.2090702@garfieldtech.com> <54F4F3FC.6060501@fischer.name> <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> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Date: Thu, 05 Mar 2015 08:51:33 +0000 To: Yasuo Ohgaki CC: "internals@lists.php.net" Message-ID: Subject: Re: [PHP-DEV] Consistent function names From: rowan.collins@gmail.com (Rowan Collins) On 5 March 2015 03:59:00 GMT, Yasuo Ohgaki wrote: >Hi Rowan, > >On Thu, Mar 5, 2015 at 10:16 AM, Rowan Collins > >wrote: > >> On 4 March 2015 21:27:53 GMT, Yasuo Ohgaki >wrote: >> >We cannot remove all issue at once. We are better to adopt >incremental >> >improvement, aren't we? >> >> I think this, more than anything else, is where I disagree (having >been >> persuaded by arguments in previous discussions). Incremental >improvements >> mean having the cost of change multiple times, and the benefit just a >> promise for the future. It's like living in a building site while >> rebuilding your house - sometimes necessary, but not what you'd >choose. >> >> If we have two names with no other fixes now, then later a third >name, or >> some magic flag, which fixes the argument order and error behaviour, >then >> go through and tidy up, we'll end up with a whole flow chart of "if >you >> need to support version X, use Y; if you find a tutorial using A, >replace >> with B..." >> >> Some such change is inevitable - a huge number of tutorials became >out of >> date when ext/mysql was deprecated, for instance - but it's not >something >> to do "little and often" just to make things "a little bit better". > > >Sounds reasonable. I've updated RFC to note not addressed >inconsistencies >explicitly. >There may be others. > >Some of these may be addressed by this RFC. > >https://wiki.php.net/rfc/consistent_function_names#unaffected_php_functionality >----------------- >Unaffected PHP Functionality > >This RFC only addresses inconsistent names. These are the list of >related >inconsistencies. > > - Parameter order inconsistency. This may be addressed by “default >namespace” in other RFC. >- Return type inconsistency. Most severe inconsistency is “wrong number >of parameters returns NULL”. This may be addressed by “INI switch” in >other >RFC. > - Constant name inconsistency. >- Class and method names. Only “__set_state()” and “create_sid()” >methods >are addressed. > >Future Scope > > - Use of namespace to clean up global namespace at all. > - New APIs that replace old APIs. > - Parameter order inconsistency. > - Return type inconsistency. > - Constant name inconsistency. > - Class inconsistency. >---------------- > >Functions return NULL for wrong number of parameters is easy one to fix >without BC. >We may have INI switch return FALSE for invalid number of parameters. > >return_value_consistency=On/Off ; Returns FALSE when number of >parameter >is wrong for module functions. > >Parameter ordering issue may be addressed also. Instead of having >alias, we >may introduce new functions >for them. The new function name could be issue, though. If you know >good >list of functions have strange >parameter ordering, I appreciate it. > >Parameter ordering issue could be addressed by "default namespace" that >can >import functions/classes >to root namespace. This approach requires more work, but it would be >cleaner than simply having new >API. I think this issue would be large enough to be a RFC, though... > >Do you have particular suggestions? You missed my point: doing this but by bit is the worst solution, not the best. One of your suggestions implies that we'll have 3 names for the same function: the one that's existed for 20 years but is a bit awkward; a new alias that fits our/your ideal naming scheme; and another with a namespace prefix which is identical except for argument order. Do you not see that that is going to be really confusing for users, no matter how clever we make the manual? If we add such functions at all, the answer to "which one should I use and why?" should be more than "whichever one was added most recently (unless you need compatibility)". That's why a radical API like scalar methods, or just a designed from scratch set of functions, is the only sensible way to move forward. Regards, -- Rowan Collins [IMSoP]