Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84537 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19312 invoked from network); 11 Mar 2015 12:33:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Mar 2015 12:33:24 -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.45 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.45 mail-wg0-f45.google.com Received: from [74.125.82.45] ([74.125.82.45:34946] helo=mail-wg0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 55/91-07702-31630055 for ; Wed, 11 Mar 2015 07:33:24 -0500 Received: by wggy19 with SMTP id y19so8914491wgg.2 for ; Wed, 11 Mar 2015 05:33:20 -0700 (PDT) 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:content-transfer-encoding; bh=l/bCveoa+ZzdAtK2KuCQV96SncDcINjHZ6kdeXYzKRY=; b=P4bAikQDxaiavCpfvHNzZR1AthhkTlGKBIf3qCv1BRwPA+ugCAeR78FwNcGGZmLGns n5kKxcnTfsdpLG6eTY4uSeXempsnVGUpWFXEf8xqia+BYGMW1XVEejrGDQac3TqdgoOA RxqzFd/aMy7F6YxG6lgAJ4f0jPcEvSYiWNegSbJ2MSr1HDuKmRFs6+kZL6n0ehM7VBzq Zz918AnYN6VmdpGL5/haTo7nPaAgWnjzTCyH4D2hjcrU1RCWaJwoUqjhB8To7dGLsQWJ YY4Jy2yqly5x1p1JiPVrfZKjXgOPzX26zo9DOsTip2MUwU8r+ofyTN5Fasm1uSp9Mu64 cX4Q== X-Received: by 10.194.216.34 with SMTP id on2mr79851847wjc.24.1426077199700; Wed, 11 Mar 2015 05:33:19 -0700 (PDT) Received: from [192.168.0.159] ([62.189.198.114]) by mx.google.com with ESMTPSA id u18sm2873957wib.1.2015.03.11.05.33.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Mar 2015 05:33:18 -0700 (PDT) Message-ID: <550035F0.10703@gmail.com> Date: Wed, 11 Mar 2015 12:32:48 +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: <54F83C4D.1020206@gmail.com> <54F8BF67.6080600@gmail.com> <848D3C19-DE29-4E5F-9B23-D87D3F4A9365@gmail.com> <54FB45D6.3040803@gmail.com> <54FCD063.4040300@gmail.com> <54FEB910.5000608@lsces.co.uk> <54FF5E39.7000507@lsces.co.uk> In-Reply-To: <54FF5E39.7000507@lsces.co.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Consistent function names From: rowan.collins@gmail.com (Rowan Collins) Lester Caine wrote on 10/03/2015 21:12: > On 10/03/15 20:44, Yasuo Ohgaki wrote: >>>> YES there is room to create a more consistent procedural interface, but >>>> my original question still applies "consistent with what rules?" >> It's possible choice. >> I agree that names without "_" looks more consistent. >> Personally, I don't care much about having "_" or not for procedural API. My >> only concern is naming consistency. >> >> Names without "_" changes basic coding rule. >> Problem is how to make a choice and how to define exceptions. e.g. >> nl_langinfo() >> >> I wonder how many of us prefer names without "_". > The one thing that your RFC demonstrates perfectly is just how much has > to change to match that rule. Change the rule and the number of names > that need alternatives is considerably less. I know a case was made at > the time for adding underscores to the guidelines but it's quite clear > that this was the mistake? PHP function names are case insensitive, and conventionally written in lower-case (a convention that nothing decided on this list will change), so underscores are important for readability. To take an example Yasuo has mentioned a couple of times, pg_lo_open() without any underscores at all would be pgloopen(), which is very hard to read: it could be pGloopen(), pgLoopEn(), pGlooPen(), pgLoOpen(), etc. For whatever reason, PHP's users decided to go with camelCase identifiers for methods, rather than underscores. I don't think that was a decision that originated in the core distribution (which for a long time had very few object APIs), and I don't think it's one that can be changed by the core distribution (or, at this stage, anyone). If PHP had had namespaces from day 1, and camel-case conventions, it would have been pg\loOpen(), but we can't change history. Regards, -- Rowan Collins [IMSoP]