> -----Original Message----- > From: Larry Garfield [mailto:la...@garfieldtech.com] > Sent: Tuesday, April 19, 2016 11:07 PM > To: internals@lists.php.net > Subject: Re: [PHP-DEV] Re: Improving PHP's type system > > strawman? A number of people are using it, and it's a flippant and insulting > ad hominem attack; from everyone using it.
While I agree that it can be insulting I do think that there's a certain degree of this happening (not necessarily in this thread or in any recent thread; I'm talking completely in general). It may not be productive to bring it up (because as you say, it can be insulting) - but given that I think that internals isn't free from it, I would hope that people will be encouraged to think hard on whether what they're proposing is truly needed, as opposed to just being useful. >It's the same thing as "PHP is not > $other_language, therefore nothing from that language is useful for PHP." Larry, I don't believe that anybody has ever said anything of the sort on internals, ever (although I've been known to readily admit I'm senile). We never block a feature from PHP because it comes from a given language. However, when considering a new feature for PHP - a procedural, OO loosely-typed language, and not a functional or strongly typed one - bringing in features that make it more functional or more strongly typed, cannot be on the grounds that they exist in other languages. Of course they exist in other languages - there are many different types of languages, PHP cannot and should not try be all of them. > PHP's history has > very clearly been one of borrowing and stealing ideas from every language we > can find if they fit and make sense in PHP (and not if they don't). I think that it's much more correct to say that PHP's history has been clearly one of borrowing and stealing ideas from C, Java and Perl, and not every language we can find. C, Java and Perl have some very strong commonalities, which is why creating a language that merged good stuff from all of them - plus adding more of our own - made sense and created a generally successful mix. But we never ever wanted, nor do we want right now, to borrow ideas from all of the languages in existence, even if they're good ideas. Good ideas exist in other languages, that don't fit PHP language characteristics. Which again, does not mean that a feature that comes from a functional/academic language is inherently disqualified, and I do maintain to nobody is saying it; But when we come to evaluate whether it "fits and makes sense in PHP", than naturally, the likelihood that it does is inherently lower. > Referencing other languages to support the inclusion of a feature is not a > coolness argument. It's a "solved problem, prior art exists" > argument. But it's a weak, almost trivial argument. It's still one that is relevant - but given that it's weak, people should not expect that by saying that "XYZ language has it", this constitutes a strong argument in its favor. If that XYZ language is from a very different language family, then as I mentioned above, it may be an indicator that it's not a very good fit for PHP. Again - not inherently disqualified - just 'raising questions'. >If a need is identified within PHP for a given feature, it is both > logical and expected to look for prior solutions to the same or similar > problems. That's the whole point of OSS. That doesn't make the solution > used by another language necessarily the right one, but it should be > considered a viable candidate. The problem is, IMHO, that we're very, VERY flexible with the definition of the word 'need'. There used to be a rule of thumb on internals that finding some use cases for a given language-level feature hardly constituted grounds to add it. It had to be useful on a very wide range of situations, in order to be worth the trouble of implementing it, maintaining it, but most of all - of adding complexity layers to the language (both in terms of cognitive burden and likelihood of misuse). Now, the whole 'complexity' factor is almost ignored. Focus is on finding a use case or a handful of use cases where the feature can be useful - a task which is almost always doable - especially when borrowing features from other languages. > Remember: > > 'Programming languages teach you not to want what they don't provide.' > --https://twitter.com/compscifact/status/375283793923670016 Is that inherently bad? It could be if it truly limits you, but if a language has a certain way of doing things, and not another - is it bad that it'd funnel you to do things its way? Is it that bad that something that wants to use functional syntax, will not embrace PHP but something else? We don't have to be everything for everyone. Regardless, at least as far as I can tell, it seems as if on internals, the sentiment is the 180 degrees opposite from Paul's statement. It's as if we feel PHP's syntax is never ever enough, and is in desperate need of extension - even though some amazingly advanced apps have been and are written on top of it. I'm not saying we should halt adding new syntax, but I am saying that (a) the pace at which we're discussing new syntax is mind boggling and way too fast, and (b) the bars we seem to be happy with in what constitutes 'need' are extremely low. I would counter that statement with this one: 'Perfection is achieved not when there's nothing more to add, but when there is nothing left to take away' IMHO, it would be AWESOME if we could funnel some of these cycles from new syntax and onto other things like parallel processing, async IO, JIT and more - which can truly take PHP to the next level. New syntax cannot. Zeev