Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70956 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35423 invoked from network); 2 Jan 2014 13:59:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Jan 2014 13:59:15 -0000 Authentication-Results: pb1.pair.com smtp.mail=nilsandre@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nilsandre@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.171 as permitted sender) X-PHP-List-Original-Sender: nilsandre@gmail.com X-Host-Fingerprint: 209.85.128.171 mail-ve0-f171.google.com Received: from [209.85.128.171] ([209.85.128.171:37112] helo=mail-ve0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D0/21-27270-1B075C25 for ; Thu, 02 Jan 2014 08:59:14 -0500 Received: by mail-ve0-f171.google.com with SMTP id pa12so7247978veb.2 for ; Thu, 02 Jan 2014 05:59:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=qwKmGsbCjlE0JP2IUZX29S8qoFhCwpbFrs7vHIr+jh8=; b=A7NmdAWd1WmaljnXjiiUqsANGp9lsEAKhZ4P5THrUOD3xjwdeMgQUsLbNupIu84avP C8UcyhV+Zr1gxeMbi2Ar0Ql3SYHRH6lM0tLpsq4mjCBIDbeOHEVb1njofqm1BrH5BJPi ymtqy27yJEjBN2iN6zLBjVFFDJXGWY2T2zDPcRLnjvEp3PO1UZomuOqUr4eYf3dqKdfz 7xQdieUEc6WEDdLs5wv/PuTRzSX0VZRAnwWrcw4EGrGCWnBMZMDFv1reWq2rYR1+XEkB +03FK1ox//+ExPclNZ9ESxzC4XvaICJUu3nSDeqVFQaqc2whnV7u5vCAw+5Lbq31o7lD FwzQ== MIME-Version: 1.0 X-Received: by 10.220.170.68 with SMTP id c4mr6260106vcz.41.1388671150577; Thu, 02 Jan 2014 05:59:10 -0800 (PST) Received: by 10.58.172.233 with HTTP; Thu, 2 Jan 2014 05:59:10 -0800 (PST) Reply-To: nilsandre@gmx.de In-Reply-To: References: Date: Thu, 2 Jan 2014 14:59:10 +0100 Message-ID: To: Pierre Joye Cc: Yasuo Ohgaki , PHP internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] [PHP6] Function name consistency From: nilsandre@gmail.com (Nils Andre) Hi Folks, I really like the idea from Larry Garfield or Pierre Joye's proposal (3). We now do have some things cluttered, and it does not matter because of what this is cluttered or if it's only the C world shining through. Programmatically spoken, to me and many OO folks, these things are inconsitently named and the strlen("somesting")... syntax is very 1980s to have. Anyways, any change should not break existing code, but must strive for new code being written to be more maintainable, readable and OOP-like. Either these functions must live in this space forever (and can get proper aliases or mappings to OO-compliant syntax), or, if one tends to disable them, we could have some switch in INI or in a script, enabling all of them back again, like init_set('PHP5_FUNC_COMPAT', true); For old projects that depend on them, the main PHP include would then include this flag and the functions would be made available. Cheers, Nils 2014/1/2 Pierre Joye : > On Dec 28, 2013 1:58 PM, "Yasuo Ohgaki" wrote: >> >> Hi all, >> >> I know this has been discussed before, but I'll try again. >> We have following coding standard >> >> 1. Function names for user-level functions should be enclosed with in >> the PHP_FUNCTION() macro. They should be in lowercase, with words >> underscore delimited, with care taken to minimize the letter count. >> Abbreviations should not be used when they greatly decrease the >> readability of the function name itself:: > > There are a couple of solutions to this problem. > > 1. Change all the existing functions signatures. Bad idea per se as we can > forget any fast adoption, if any at all. Will be very painful to migrate > existing code > > 2. Add aliases all around. > Not a big fan of that one either. It clutters the php NS a lot without > factual gains > > 3. Try to implement nickic's prototype to add methods to scalar related > types, should work with complex types as well > > I would prefer to give 3. a try, while it could be tricky to implement a > technically acceptable solution. > > Pros: > > . It will bring consistent APIs > . does not add dozen of aliases for little gains > . fully BC > . fits more to current development habits > > Cons: > . still have to be careful by designing the new "methods" > > Cheers, > Pierre