Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84266 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97664 invoked from network); 3 Mar 2015 22:13:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Mar 2015 22:13:22 -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 74.125.82.169 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.169 mail-we0-f169.google.com Received: from [74.125.82.169] ([74.125.82.169:35069] helo=mail-we0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 55/21-22264-00236F45 for ; Tue, 03 Mar 2015 17:13:21 -0500 Received: by wevl61 with SMTP id l61so42758193wev.2 for ; Tue, 03 Mar 2015 14:13:17 -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=5GN0kclXe2l+gOeH9qK7fnAg+iTNW1yQ6thRbqkio2Y=; b=V8GRoaxfXwLVZp1i+EZ8mG4Wu//iOSrNrWkdglwdL8KibqhHXROWGFrsR+t1zdw2Bw Aga/jCBAoxT4Cp8Fa7D6pK5SdAmFIFeDpAD0uPmhEj8E7hY+w40A3JCIJLlflWzokb2j sUvW2t1bbrxSIom2NTE/OOSBYxNhB4RlJU479Y/3r7jxUKPQy9Ej1jpFS55lCokY5U/L sspwrOhAWfDRd/1TldRXUNIea4aELSshH0giQ8/WbsdvzcA0a06v3zpHbd3vf5vp3PfN ViggVJ26U5GUKORuIRcInRAxD6qeGOyVkESX0Rc8EPrxgNcpa3/LF62XI6Huw+QtZvGj EBow== X-Received: by 10.180.206.83 with SMTP id lm19mr6883862wic.41.1425420797680; Tue, 03 Mar 2015 14:13:17 -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 q20sm604875wiw.7.2015.03.03.14.13.16 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Mar 2015 14:13:16 -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> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Date: Tue, 03 Mar 2015 22:12:10 +0000 To: Yasuo Ohgaki CC: "internals@lists.php.net" Message-ID: <554F0C3F-770F-4694-A5AB-FDC54FCCBF00@gmail.com> Subject: Re: [PHP-DEV] Consistent function names From: rowan.collins@gmail.com (Rowan Collins) On 3 March 2015 18:54:56 GMT, Yasuo Ohgaki wrote: >Hi Rowan, > >On Tue, Mar 3, 2015 at 7:13 PM, Rowan Collins >wrote: > >> Yasuo Ohgaki wrote on 03/03/2015 04:01: >> >>> Hi Lester, >>> >>> On Tue, Mar 3, 2015 at 9:19 AM, Lester Caine >wrote: >>> >>> On 02/03/15 23:54, Yasuo Ohgaki wrote: >>>> >>>>> This looks awful... just cannot put up with... >>>>> >>>> Rasmus has already answered, but are you prposing to rewrite -> >>>> http://www.gnu.org/software/gettext/manual/gettext.html >>>> >>> >>> I know we used to have had copy of C library names. >>> I already explained why it looks awful. It violates coding standard >and >>> sitting in PHP for more than a decade as it is. >>> >> >> You keep mentioning this coding standard like it's the Holy Bible. >Coding >> standards are only as useful as the problem they're trying to solve, >and >> there can always be justified exceptions to the rule. >> >> I doubt most PHP users look at that list of functions and think "tsk, >tsk, >> the PHP devs didn't follow their own coding standards". They might >think >> "why are these functions named the way they are?", in which case >Rasmus has >> provided the answer, in terms of "vertical consistency" with >cross-language >> libraries. >> > >First of all, I'm not blaming anyone who named functions that violates >coding standard. >It was ok name them like this. I would name after under laying library >functions also. > >If the cost of having consistent name is too high (too much >cpu/mem/etc) , 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. Regards, -- Rowan Collins [IMSoP]