Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71526 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60842 invoked from network); 24 Jan 2014 20:27:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jan 2014 20:27:48 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.53 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.215.53 mail-la0-f53.google.com Received: from [209.85.215.53] ([209.85.215.53:65201] helo=mail-la0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F0/D7-21270-2CCC2E25 for ; Fri, 24 Jan 2014 15:27:47 -0500 Received: by mail-la0-f53.google.com with SMTP id e16so2974920lan.12 for ; Fri, 24 Jan 2014 12:27:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=IkUwUBAUTvGolY13ZqJAYeIAo5nE8E5CD9pZ5fOsb+8=; b=ZoGY8jBQq5dsSWRFvct8FSy6x4HYL4XKfvwnUyQmCQzM7FZDD7vNmX6VbceRT60uVj jkBTOLJ4CGZPhsC3kqe8Pu1qF+gLQudqWP44CQsYz0U4yc5sdU0fwc9x8kEfK1DJudKv VhiAGAkz1kdjkN+899jcfj+Vq0M3O4SybbuOuhhB59ylr17mlF6Y5s8SFGJbfm2WuYhv BCBeoA+9pBzmufivV0nvthQluFxZPx+HBpjfj0JBmjijbTXQIOTTvyKmKz/XP8Oj0e2b hC2zlt2SR99lFF68ht3a/3nI/UWFdIYE74BSRz/kZRevrm9HPdXN+Ex9ukVZRKXbBRz4 5jUA== X-Received: by 10.112.11.170 with SMTP id r10mr9560107lbb.23.1390595263839; Fri, 24 Jan 2014 12:27:43 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.132.134 with HTTP; Fri, 24 Jan 2014 12:27:02 -0800 (PST) In-Reply-To: <52E1BDB0.6050406@garfieldtech.com> References: <7E.A3.39789.25841E25@pb1.pair.com> <12.A5.39789.B7851E25@pb1.pair.com> <52E16E01.7070401@gmail.com> <52E1BDB0.6050406@garfieldtech.com> Date: Sat, 25 Jan 2014 05:27:02 +0900 X-Google-Sender-Auth: QZADCxfvAkAfmAJsad8q73NKlck Message-ID: To: Larry Garfield Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11c3be5eba432804f0bd30bc Subject: Re: [PHP-DEV] Re: [PHP6] Function name consistency From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c3be5eba432804f0bd30bc Content-Type: text/plain; charset=UTF-8 Hi Larry, On Fri, Jan 24, 2014 at 10:11 AM, Larry Garfield wrote: > On 1/23/14 1:31 PM, Rowan Collins wrote: > > Therein lies the whole problem with adding more aliases - it just makes >> things more inconsistent, as developers can use (deliberately or >> accidentally) different names for the same function. >> >> I still have to think a moment when I see sizeof() or print, rather than >> count() or echo - let alone having to remember which version of PHP >> introduced which alias so that libraries don't break when deployed to >> older servers. >> >> I think it's far better to have replacements for whole sets of functions >> that are clearly "new and shiny" - be that OO strings and arrays, or >> just namespaces for extensions like mbstring. In fact, a namespace for >> mbstring could allow a much cleaner version of the "override normal >> string functions" system, because you could just "use" the namespace, >> and have functions with overlapping names... >> >> Regards, >> Rowan Collins >> [IMSoP] >> > > Agreed. Simply aliasing a bunch of functions offers no useful value, but > does increase confusion. ("Wait, do I use strcmp() or string_compare() on > this project? What version are we on again? Oh, look, this library uses > both. Must have been different devs. FML.") > > If we're going to do anything, be aggressive and far-reaching with it. > Build a proper language-level OOP design for string/array manipulation. > > We have enough functions lying about. Don't add more. We should be careful choosing names. I agree. However, not adding more function names is simply impossible. For example, I'm about to add new session function named string session_create_id([string $prefix]) for user save handlers, so that user could generate secure ID easily. It's a straight name for session ID creation and there might be users using this name. Not adding any new names means not adding any new features nor cleanups. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11c3be5eba432804f0bd30bc--