Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84336 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24617 invoked from network); 5 Mar 2015 11:49:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Mar 2015 11:49:46 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.177 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.217.177 mail-lb0-f177.google.com Received: from [209.85.217.177] ([209.85.217.177:40894] helo=mail-lb0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 42/01-18504-7D248F45 for ; Thu, 05 Mar 2015 06:49:44 -0500 Received: by lbiw7 with SMTP id w7so11365458lbi.7 for ; Thu, 05 Mar 2015 03:49:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=IQRnNvMXRtnCEMuokAQvLlkXRW0MBfCt7gJJ9yUZC7o=; b=FtW32myDKxk6CUReOEycAosjYux43r7qNHjpu02tesdgQxPGIqcwWwogvnIGx++Izy MEMIpIywXL2T6oDXlQgwm6t70rI4Ubl7zYFkhYxajRIn05JYd88ymVWiqY8iNzgduN9l ZIoQLF2tGyN+du7s1RJSrG3dSXAO3QGQFOvX+xVlffJw7N3cpeWt0H3oiAtcRNGorZEW qWpesaR3ji51IUgR0AnsiW5sIgmumVNVp4uV9cntCt0kgIcGuCo/XFUo+xuD5FXL6MAc mTSKHdBJFNWgzeXnbjW4+XpH9UtnMevmOsAqgU0eLDigLHyUR47sufqSxYL80vJo7SB9 3zUQ== MIME-Version: 1.0 X-Received: by 10.153.8.135 with SMTP id dk7mr7253666lad.93.1425556180315; Thu, 05 Mar 2015 03:49:40 -0800 (PST) Received: by 10.112.181.41 with HTTP; Thu, 5 Mar 2015 03:49:40 -0800 (PST) In-Reply-To: <54F83C4D.1020206@gmail.com> References: <54F4E93C.80206@gmail.com> <54F4EBEC.2090702@garfieldtech.com> <54F4F3FC.6060501@fischer.name> <54F4FDFB.8010701@lsces.co.uk> <54F5895D.3090002@gmail.com> <554F0C3F-770F-4694-A5AB-FDC54FCCBF00@gmail.com> <1FCB68B8-3E55-4B5D-B805-9D92D848A3A1@gmail.com> <5D8591E2-5AE6-4B4C-AAE0-3D15523410AC@gmail.com> <54F83C4D.1020206@gmail.com> Date: Thu, 5 Mar 2015 03:49:40 -0800 Message-ID: To: Rowan Collins Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Consistent function names From: pierre.php@gmail.com (Pierre Joye) On Thu, Mar 5, 2015 at 3:21 AM, Rowan Collins wrote: > Yasuo Ohgaki wrote on 05/03/2015 09:24: >> >> I would love to have new OO APIs for variables. I also like to write >> procedural >> code for simple scripts. Therefore, even if we have new OO APIs, I would >> like to >> improve/maintain procedural functions and make them not legacy functions. > > > I don't see scalar methods primarily as a way to make PHP more OO (it's just > syntax sugar, at the end of the day), but as an opportunity to bring in a > new API with real advantages. > > As Jordi says in the other thread, there are other things you could improve > about the array functions beyond making the argument order match the string > functions. If you were to sit down and design a new set of array functions > (for instance), which were a valuable replacement for the old ones, you > wouldn't also need to add dozens of aliases to the old set, because your new > set could have a consistent and intuitive naming and behaviour convention. > > Scalar methods are just one way of designing that new set of functions, but > you could just make a namespace of completely redesigned functions, with > deliberately new names to make it obvious which set was being used. At that > point, having the aliases you're proposing would be actively harmful, > because now users would have to ask (themselves/the manual/Stack Overflow) > "is this the new function, or just the new name for the old function?" I will say it again a last time, in my opinion only a clean API; object-like or real object as long as performance is not affected is the only way I could see to actually solve this problem. Changing the names, argument order (pointless once we will have named arguments, btw) and similar solutions are band aids solutions, confusing at best, terrible at worst. It is pointless to do it after almost two decades for some of them. -- Pierre @pierrejoye | http://www.libgd.org