Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84626 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44840 invoked from network); 12 Mar 2015 10:20:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Mar 2015 10:20:49 -0000 Authentication-Results: pb1.pair.com header.from=arvids.godjuks@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=arvids.godjuks@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.181 as permitted sender) X-PHP-List-Original-Sender: arvids.godjuks@gmail.com X-Host-Fingerprint: 209.85.214.181 mail-ob0-f181.google.com Received: from [209.85.214.181] ([209.85.214.181:33107] helo=mail-ob0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 15/60-42021-08861055 for ; Thu, 12 Mar 2015 05:20:49 -0500 Received: by obcvb8 with SMTP id vb8so14148871obc.0 for ; Thu, 12 Mar 2015 03:20:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=lWunB8PVozCrixK/Am5GvY1/S1e3lOJ3oQCYL3GK2CI=; b=0yVmOXdzWjcQDT7D+mabHxOVGXSRRgP+dcnj1L1DLAks1UDDAKvaL8yVsczBGSnf2N 8YACFVKiT8M5Yi8N8kwJiap58xwFYf1e/91xyd3mZeFYH5zDoD//NwUqQzFFoXXb/GHc C6owga5761Gm4HqIXcDDk9Wa5K+mWVZ6YyHuCw+UYjiE8upx85K+TXjS4W2j0oatJVMo sGkGqJznoKKwTvBJSkuBTUKkP9KnA26wEC+sb8NbHTBbzeoan63D56o/p+lm5ORDrfJN gnDtY5I6zlWHRTzhmO7e7XLKF2ExZSn7DX0B7CMvTzsgZlJ8DkWwBW6fP0y0mg7kVO2Z qKAw== X-Received: by 10.182.20.195 with SMTP id p3mr32677196obe.1.1426155645954; Thu, 12 Mar 2015 03:20:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.60.14.39 with HTTP; Thu, 12 Mar 2015 03:20:24 -0700 (PDT) In-Reply-To: <55015F44.7070103@lsces.co.uk> References: <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> <550035F0.10703@gmail.com> <5500F527.1030606@lsces.co.uk> <55015F44.7070103@lsces.co.uk> Date: Thu, 12 Mar 2015 12:20:24 +0200 Message-ID: To: Lester Caine Cc: PHP internals Content-Type: multipart/alternative; boundary=e89a8f50316cabf3b9051114bc13 Subject: Re: [PHP-DEV] Consistent function names From: arvids.godjuks@gmail.com (Arvids Godjuks) --e89a8f50316cabf3b9051114bc13 Content-Type: text/plain; charset=UTF-8 2015-03-12 11:41 GMT+02:00 Lester Caine : > On 12/03/15 09:21, Arvids Godjuks wrote: > > Basically this. > > > > Yasuo asked me some time ago how do I see the new interface, and to be > > frank, I do not see a new procedural api interface at all. We have one > > now, and adding a new subset of it looks pointless. It has it's problems > > and legacy, you can't really fix it. Maybe some adjustments are in order > > to make it more consistent where it can be done. > > > > I really see only the OO API as a new additional interface. It's part > > started by the DateTime, the MySQLi classes and stuff. At this point all > > that stuff can be still namespaced, adjusted if needed and continued, > > just from the std library first. > > I, actually, use _ for function and variable naming and camelCase for > > object methods and properties. To be frank, I like it - it visually > > clearly separates the code styles and for the most part the PHP code is > > written that way (well, the MySQLi has ->num_rows and stuff - i'd change > > it to ->numRows and so forth). > > This is exactly the same point I've come to ... > > That MySQLi example is exactly what I am talking about. I know Postgres > driver has been 'underscored' but it is THAT which is out of sync with > the rest of the code base. interbase driver has the same problem, and we > will need to bring in fbird_ to replace ibase_ there, but I use ADOdb > almost exclusively which has been CamelCase since day one ( all be it > with a leading capital ). PDO is camelCase but that has other problems ;) > > If there has to be any tidy up, like you, I think switching back to > loose some underscores is the less painful option. > > -- > Lester Caine - G8HFL Do you mean the PostgreSQL driver needs to be changed from pg_blah() to pgBlah() ? If that's the case - why? For procedural API that's totaly fine. As I said, I think the functions with _ word separator are totaly fine and it's really no need to change that. The OO interface, that needs to be build eventually, that one should use camelCase for all the methods and properties. This way the code style clearly separates the OO inteface and the procedural interface. And I think it's good. At least it served me well all my 10+ years with PHP. Arvids. --e89a8f50316cabf3b9051114bc13--