Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67943 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40973 invoked from network); 27 Jun 2013 12:52:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jun 2013 12:52:15 -0000 Authentication-Results: pb1.pair.com header.from=tjerk.meesters@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tjerk.meesters@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.48 as permitted sender) X-PHP-List-Original-Sender: tjerk.meesters@gmail.com X-Host-Fingerprint: 209.85.216.48 mail-qa0-f48.google.com Received: from [209.85.216.48] ([209.85.216.48:47389] helo=mail-qa0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F5/71-34034-E753CC15 for ; Thu, 27 Jun 2013 08:52:14 -0400 Received: by mail-qa0-f48.google.com with SMTP id cm16so527923qab.14 for ; Thu, 27 Jun 2013 05:52:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=WwQA+pwLzN/81e37aFIW7JClqLQPfOAPLAxlfpoTiWk=; b=xFo7Nif31h0m9V7WIGrLPeIVsIdbXdYd/2nmlikhs3VY71Fs9+iR4VFh3axZ8LKMhO e9h9PdZoVmqloE7hdiv2c6zco2FEdxxkYtTAZx52kngAy5Ew0NJkkLJsoKbkQjs+kAhQ cFIqvmRuXxEn1VUOKGCPz5K1XzZg81tZo3WYBc+xqLabh9ghwaLiXmT5ULDhQgBhdqGP DFoVsOAwI/3OxHKQ3kteP1M4EAAZCBqT+M4JbjMjOvEyLJA9Y2Akm4p83lmco1yeStKD 5BhzSIqk9axD0yl0kbMAM9NWN3MFjMbuKHeOR+aL9R5odkwheZuZNsCdIJL78bbdGz2c 9U9w== MIME-Version: 1.0 X-Received: by 10.224.123.3 with SMTP id n3mr4699551qar.77.1372337531377; Thu, 27 Jun 2013 05:52:11 -0700 (PDT) Sender: tjerk.meesters@gmail.com Received: by 10.49.99.67 with HTTP; Thu, 27 Jun 2013 05:52:11 -0700 (PDT) In-Reply-To: References: <4622f2d7-8c09-4a31-943e-7732a9481a9a@me.com> Date: Thu, 27 Jun 2013 20:52:11 +0800 X-Google-Sender-Auth: fj5RfqySVhGG-XiD3Y8uuN6Fkf8 Message-ID: To: Richard Bradley Cc: Florin Patan , Jeremy Curcio , PHP Internals , Sebastian Krebs Content-Type: multipart/alternative; boundary=089e015387da11de4c04e0223b97 Subject: Re: [PHP-DEV] Gauging Interest:RFC to add map() function From: datibbaw@php.net (Tjerk Anne Meesters) --089e015387da11de4c04e0223b97 Content-Type: text/plain; charset=ISO-8859-1 On Thu, Jun 27, 2013 at 7:13 PM, Richard Bradley < Richard.Bradley@softwire.com> wrote: > > -----Original Message----- > > From: tjerk.meesters@gmail.com [mailto:tjerk.meesters@gmail.com] On > Behalf Of Tjerk Anne Meesters > > Sent: 27 June 2013 11:24 > > To: Sebastian Krebs > > Cc: Florin Patan; Jeremy Curcio; PHP Internals > > Subject: Re: [PHP-DEV] Gauging Interest:RFC to add map() function > > > > On Thu, Jun 27, 2013 at 5:43 PM, Sebastian Krebs >wrote: > > > > > > > > > > > > > > 2013/6/27 Tjerk Anne Meesters > > > > > >> On Thu, Jun 27, 2013 at 4:27 PM, Florin Patan > > >> wrote: > > >> > > >> > On Thu, Jun 27, 2013 at 10:17 AM, Tjerk Anne Meesters > > >> > > > >> > May I kindly ask why all the PHP users would want this function in > > >> > the core? > > >> > > > >> > > >> Are you meaning to ask why would *any* php user want this function in > > >> the core? As with most things, the need of one may be shared among a > > >> critical mass that could swing the balance. In practice though, the > > >> critical mass is usually determined by the internals peeps :) > > >> > > > > > > But this method is _really_ quite special, isn't it? I cannot imagine, > > > that there is "critical mass", that needs this _in core_. > > > > > > > I'm not casting any judgement on its usefulness; I'm merely arguing the > > "why should this be in core? I would never use it." narrative is not > constructive. > > It can serve as an indication of which way the he would vote if this came > to RFC. > It can give a single data point towards how many people would find this > useful. > You did ask what people thought of the proposed method. I don't think you > should simply reject negative answers as "not constructive". > To be clear, I'm not the person who proposed the patch, so I'm not the one asking for opinions; I'm merely an engaged bystander if you will. That said, "providing a single data point" which loosely translates to a thumbs up or down and being non-constructive are not mutually exclusive terms; the constructive element here refers to the value it adds to the discussion. In other words, saying "Boo! -1" serves as a statistic, but a good argument benefits the proposer most imo. > > > >> > And as I understand, PHP delegates the math stuff to the underlying > > >> > C implementation so why would it be faster having it in PHP core > > >> > rather that in PHP userland? > > >> > > > >> > > >> Performance is not the only reason why features make it into the > > >> core; it's providing a rich set of built-in features to make the > > >> developer's lives easier, such as the latest password hashing API > > >> which is easy to get wrong or generators that reduce boiler plate > > >> code. > > > > > > You cannot compare language features (generators) with functions. And > > > "security" is always a topic on its own. > > > > > > > I consider new functions as a feature of the language as well, so > there's no need to make comparisons. > > > > That said, would you have guessed (without looking at the manual) that > PHP exposes a > > "hypot($x, $y)" where you could otherwise have written "sqrt($x * $x, $y > * $y)"? > > > > Okay, it's a translation from of course, but it came as a > surprise to me :) > > There is a good reason to have "hypot" in the C layer -- it is not > possible to implement it in PHP correctly (and efficiently), due to > overflow concerns. > > See http://en.wikipedia.org/wiki/Hypot for a summary. > > This wasn't meant to be taken at face value; it was part of the argument that some functions may not seem useful at first glance. I'm of course not arguing that hypot() is simply added fluff, that's pretty clear from referencing the man(ual) page, though for the fun of it you should search for this function on stackoverflow to gauge how often it's used. The same concerns do not apply to this affine transform, which is why it > should not be in core. > Whether a C implementation is a hard requirement could be used as a deciding factor, yes, but otherwise I wholeheartedly disagree with that statement :) there are enough functions in the core that could be correctly and in some cases also efficiently be implemented in userland. > > If there were sufficient demand for it, then it might justify a PECL > extension. My impression is that there is not. > Indeed. Perhaps an extension dedicated to working with range operations in general may be a useful addition. It would definitely be a good learning experience, assuming said proposer would take up this job himself :) > > Best, > > > > Rich > > > > Richard Bradley > Tel : 020 7485 7500 ext 3230 | Fax : 020 7485 7575 > > softwire > Sunday Times Best Small Companies - UK top 20 three years running > Web : www.softwire.com | Addr : 325 Highgate Studios, 53-79 Highgate > Road, London NW5 1TL > Softwire Technology Limited. Registered in England no. 3824658. Registered > Office : 13 Station Road, London N3 2SB > > -- -- Tjerk --089e015387da11de4c04e0223b97--