Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84270 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8891 invoked from network); 4 Mar 2015 00:47:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Mar 2015 00:47:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.179 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.216.179 mail-qc0-f179.google.com Received: from [209.85.216.179] ([209.85.216.179:45654] helo=mail-qc0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9C/B2-22264-42656F45 for ; Tue, 03 Mar 2015 19:47:32 -0500 Received: by qcvp6 with SMTP id p6so33653612qcv.12 for ; Tue, 03 Mar 2015 16:47:29 -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=ytPT8SPHhUniUxX92+LyshUlSsuijoyAKlNF4IjlYX0=; b=H0Zg876jvtj39Qo+iJ0xGTy8LIbhGZ1ran4PsWd8M49Q09TAjBaP4UefUmAbStd7ml 2/VaudIsniGMIUmYZOXvHH2OEzRhepiQUWJpIoPxwiWvKu+016YdHFn++5VvSXiv0bQZ /zjKfYHYowskDBXEcwaR9oO6eQFg/h5PiPTfLscZNTdU6S6rfNXhSPtGxQwhdlUvTWjB gSCWpFAgcYLN1bESIYK8Zu2vk7T9wjajykq0LYeLqJpOeb9w7Jo1I+VTF6YhG/oMB8Y8 igWB8g27FzhwnAyvf3PTFPbMXBO8rSsHwBokPI46B5FT+FlXGRf6uODN53ogFfnDUjaP 1Gqw== X-Received: by 10.55.24.104 with SMTP id j101mr2991135qkh.0.1425430049881; Tue, 03 Mar 2015 16:47:29 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.229.198.8 with HTTP; Tue, 3 Mar 2015 16:46:49 -0800 (PST) In-Reply-To: <554F0C3F-770F-4694-A5AB-FDC54FCCBF00@gmail.com> References: <54F4E29D.7080501@garfieldtech.com> <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> Date: Wed, 4 Mar 2015 09:46:49 +0900 X-Google-Sender-Auth: 4c75BOr7y6HY5xd1EZbRWdx-BIs Message-ID: To: Rowan Collins Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a1142e968c6835f05106bcb1a Subject: Re: [PHP-DEV] Consistent function names From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a1142e968c6835f05106bcb1a Content-Type: text/plain; charset=UTF-8 Hi Rowan, On Wed, Mar 4, 2015 at 7:12 AM, Rowan Collins wrote: > You are measuring the wrong cost. The cost of adding new names is to > people writing code: > > - additional confusion for new users about why everything has two names > and which they should use > - extra effort for new developers to learn the new names, even if they > only read them in other people's code (it slows me down every time I see > sizeof() and have to remember it's just an alias of count()) > - awkward decision for project leaders: use the old names for familiarity > and compatibility with older versions, or the new ones because they're > arguably better names > - if an existing project does choose the new names, the overhead of > converting all the existing code, with the risk of bugs introduced by > incorrect automation, noise in commit logs, merge conflicts, etc > - if a project needs to run on PHP 5, the vigilance required to avoid > accidentally using the new names when developing on PHP 7 > > That's not an exhaustive list, and some of these aren't huge costs, but > collectively they outweigh the benefit of a slightly more consistent set of > names for things. > > This is why a more radical change - an OO-style API for scalars and basic > modules, a fundamentally new set of functions which fulfil a specific need, > etc - has the potential for acceptance, and this proposal does not. The > costs are mostly fixed, so we need to increase the benefits to outweigh > them. > This is fair discussions. We should care these also. I agree these costs exist and shouldn't ignored. I have different point of views. It's long term view or new user point of view. For me, it outweighs costs you've mentioned. Whether we like it or not, people evaluate languages by matrix like PHP Ruby Python OO support 5 5 5 Flexible syntax 3 5 5 AOP support 3 3 3 DbC 1 2 2 API consistency 1 3 3 API richness 4 4 4 3rd Party Libs 4 4 4 Performance 4 3 3 Security 1 4 4 Type Safety 1 4 3 Although this is rough evaluation by me, people would have somewhat similar matrix. API consistency 1 3 3 The reasons why people evaluate PHP like this are - PHP has API inconsistency even for most basic APIs like phpversion(), htmlspecialchars(), etc - Even bundled modules have non standard function names. - API parameter ordering is inconsistent. - Return type for errors are inconsistent. e.g. Wrong number of param returns NULL, while others return FALSE mostly. - Some basic internal classes do not raise exception for instantiation failure. - and so on. I'm not saying Ruby's APIs are organized very well. For example, user has to search around proper API even for URI escape provided by various modules. Therefore, I evaluate it as 3. Having this kind of evaluation matrix is not good for PHP in the long run. IMHO. BTW, Security 1 4 4 I evaluate like this because PHP is to weak against fatal security breach. i.e. Script Inclusions. You'll see my view and the reason why I focus in some area strongly from the matrix. Although I didn't participate scalar type hint RFC discussion much, I cannot wait to have StrictSTH also. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a1142e968c6835f05106bcb1a--