Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84283 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51487 invoked from network); 4 Mar 2015 09:17:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Mar 2015 09:17:41 -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 74.125.82.175 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.175 mail-we0-f175.google.com Received: from [74.125.82.175] ([74.125.82.175:37293] helo=mail-we0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AA/50-49216-4BDC6F45 for ; Wed, 04 Mar 2015 04:17:40 -0500 Received: by wesw55 with SMTP id w55so44935545wes.4 for ; Wed, 04 Mar 2015 01:17:36 -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=rTWLJjaSjvgYEsu0IX8Bq8F2lfRfshyvep7EDX+h4II=; b=rLbGAMykwKTTzZX6FNz1ut5hKSTYKHff14O4XyvC0APApGWryHtnSatfI/BsDwCULe /fMnUnSFnjK0gL2SbwNYpH4XLuYUNTFXqkb8lYorEER7IJwoL3WCruS3gAoEarymPnhD xHIJUaQNq2t4SgAe3bQLxGHKbobbh3c8b25uNCe9NDhQWc2HxEJlPzq8g5zEB6oM7Nyz JkocmGxD2uV7hgWoZ9bbed6WUo/woyo48K1tQ4nGri5Vm9r/z/k0N/uqAMouHPYzlpni frVW7mPtXGg/Qr78vpzrJcqpI4nhjbbxEcfb8IKNfp6iqhhgcMDPXF5lPl9KT0tzk0dI VEwQ== X-Received: by 10.180.7.196 with SMTP id l4mr31065158wia.44.1425460655142; Wed, 04 Mar 2015 01:17:35 -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 uo6sm5004939wjc.49.2015.03.04.01.17.33 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Mar 2015 01:17:34 -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> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Date: Wed, 04 Mar 2015 09:16:29 +0000 To: Yasuo Ohgaki CC: "internals@lists.php.net" Message-ID: <1FCB68B8-3E55-4B5D-B805-9D92D848A3A1@gmail.com> Subject: Re: [PHP-DEV] Consistent function names From: rowan.collins@gmail.com (Rowan Collins) On 4 March 2015 00:46:49 GMT, Yasuo Ohgaki wrote: >Hi Rowan, > >On Wed, Mar 4, 2015 at 7:12 AM, Rowan Collins >wrote: > >> You are measuring the wrong cost. The cost of adding new names is to >> people writing code: >> >> - additional confusion for new users about why everything has two >names >> and which they should use >> - extra effort for new developers to learn the new names, even if >they >> only read them in other people's code (it slows me down every time I >see >> sizeof() and have to remember it's just an alias of count()) >> - awkward decision for project leaders: use the old names for >familiarity >> and compatibility with older versions, or the new ones because >they're >> arguably better names >> - if an existing project does choose the new names, the overhead of >> converting all the existing code, with the risk of bugs introduced by >> incorrect automation, noise in commit logs, merge conflicts, etc >> - if a project needs to run on PHP 5, the vigilance required to avoid >> accidentally using the new names when developing on PHP 7 >> >> That's not an exhaustive list, and some of these aren't huge costs, >but >> collectively they outweigh the benefit of a slightly more consistent >set of >> names for things. >> >> This is why a more radical change - an OO-style API for scalars and >basic >> modules, a fundamentally new set of functions which fulfil a specific >need, >> etc - has the potential for acceptance, and this proposal does not. >The >> costs are mostly fixed, so we need to increase the benefits to >outweigh >> them. >> > >This is fair discussions. We should care these also. I agree these >costs >exist >and shouldn't ignored. > >I have different point of views. It's long term view or new user point >of >view. >For me, it outweighs costs you've mentioned. Several of the costs I listed are for new users, and several will continue indefinitely if we don't remove the old names, and are therefore long term. Could you be more explicit in the benefits you see? I.e. day to day, how will users lives be better with these new names? >- PHP has API inconsistency even for most basic APIs like phpversion(), >htmlspecialchars(), etc > - Even bundled modules have non standard function names. > - API parameter ordering is inconsistent. > - Return type for errors are inconsistent. e.g. Wrong number of param >returns NULL, while others return FALSE mostly. For me, argument order and return inconsistency is a much worse problem than name inconsistency. Unfortunately, it's also harder to fix without massive BC breaks. Again, this leads to the conclusion of replacing the entire legacy API, rather than trying to patch over it. I also think having two names for every function will count as a negative to the kind of people who write these matrixes, and the fact that it was done to fix a previous negative won't change that. Regards, -- Rowan Collins [IMSoP]