Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92317 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84375 invoked from network); 14 Apr 2016 20:51:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Apr 2016 20:51:48 -0000 Authentication-Results: pb1.pair.com header.from=zeev@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=zeev@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 157.56.111.105 as permitted sender) X-PHP-List-Original-Sender: zeev@zend.com X-Host-Fingerprint: 157.56.111.105 mail-bn1bbn0105.outbound.protection.outlook.com Received: from [157.56.111.105] ([157.56.111.105:33851] helo=na01-bn1-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 58/93-64966-2E200175 for ; Thu, 14 Apr 2016 16:51:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=RWSoftware.onmicrosoft.com; s=selector1-zend-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=tPt66Vi+k8RKW1W6p6FyDVCBaCJQjWr3jm8gwN3jx9s=; b=22m0uX8OHdU8etfMVeYhE8O3imG25uUeZZHcO9FVBDulVotBV8Muti5lFbbB3L2xIcubzIhcRL/2AUvHQwvshTVJyqDy3QtAaPz4/xAHm9HpV+m/VAkj5nfoOK+B8WgsyVfgiP4QeYqKQqIH8NzmwtCrBvC7QoRQLUg+IAed3VM= Received: from BY2PR02MB298.namprd02.prod.outlook.com (10.141.140.21) by BY2PR02MB300.namprd02.prod.outlook.com (10.141.140.26) with Microsoft SMTP Server (TLS) id 15.1.447.15; Thu, 14 Apr 2016 20:51:42 +0000 Received: from BY2PR02MB298.namprd02.prod.outlook.com ([10.141.140.21]) by BY2PR02MB298.namprd02.prod.outlook.com ([10.141.140.21]) with mapi id 15.01.0447.029; Thu, 14 Apr 2016 20:51:43 +0000 To: Tony Marston CC: "internals@lists.php.net" Thread-Topic: [PHP-DEV] Re: Improving PHP's type system Thread-Index: AQHRlaUHEc+doe0x5E+u9VwQHuu4UJ+IRQcAgAANKICAAAFxgIAABh6AgAANpACAACnEH4AAm82AgAC9A4A= Date: Thu, 14 Apr 2016 20:51:42 +0000 Message-ID: References: <570E99AC.3090804@fleshgrinder.com> <570EA5EB.8090501@fleshgrinder.com> <570EAB0D.6080706@gmail.com>,<570EB67E.8010908@garfieldtech.com> <5B147E88-CC0A-4CBC-A49D-C7FE3BF557C0@zend.com> <6F.C3.12455.94C5F075@pb1.pair.com> In-Reply-To: <6F.C3.12455.94C5F075@pb1.pair.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: hotmail.com; dkim=none (message not signed) header.d=none;hotmail.com; dmarc=none action=none header.from=zend.com; x-originating-ip: [115.186.227.30] x-ms-office365-filtering-correlation-id: 6f2ba2df-eeaf-4913-12a7-08d364a695d4 x-microsoft-exchange-diagnostics: 1;BY2PR02MB300;5:fydDF4+HeElQ2+h0++iMatct/CM35N9b2gVGSRzFFJ/YyT9gmKiwW9qUdnWFioN/0iTuL/NOE/vRKHEuwP9XZ8zGWUnOecYJx8jWILreXRZqAlYAh09Hq2ja0XcQyZ3vJhVyhx6ODSQVv2N0swWlVw==;24:N+EYJ+JZ1Y+gb3JBt1UYQKwghGQWKjS64h9y4gfTsA9waa5nPzryVLCNJqxpGiPacvccDB9xRVUwKZHQ6nag2VwQLkqa/pHP4NZgwF7YCTQ= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR02MB300; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001);SRVR:BY2PR02MB300;BCL:0;PCL:0;RULEID:;SRVR:BY2PR02MB300; x-forefront-prvs: 0912297777 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(377454003)(13464003)(24454002)(586003)(106116001)(189998001)(86362001)(2900100001)(1096002)(4326007)(81166005)(3846002)(33656002)(99286002)(5003600100002)(66066001)(1220700001)(10400500002)(19580405001)(76176999)(6116002)(74316001)(19580395003)(2906002)(92566002)(5004730100002)(110136002)(3660700001)(93886004)(2950100001)(3280700002)(54356999)(50986999)(5008740100001)(575784001)(5002640100001)(122556002)(9686002)(76576001)(87936001)(102836003)(77096005);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR02MB300;H:BY2PR02MB298.namprd02.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Apr 2016 20:51:42.7652 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 32210298-c08b-4829-8097-6b12c025a892 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR02MB300 Subject: RE: [PHP-DEV] Re: Improving PHP's type system From: zeev@zend.com (Zeev Suraski) > -----Original Message----- > From: Tony Marston [mailto:TonyMarston@hotmail.com] > Sent: Thursday, April 14, 2016 12:01 PM > To: internals@lists.php.net > Subject: Re: [PHP-DEV] Re: Improving PHP's type system >=20 > "Zeev Suraski" wrote in message > news:5B147E88-CC0A-4CBC-A49D-C7FE3BF557C0@zend.com... > > > > > >> On 14 ????? 2016, at 7:14, Larry Garfield wro= te: > >> > >>> On 4/13/16 3:24 PM, Stanislav Malyshev wrote: > >>> Hi! > >>> > >>>> May I suggest you the following article (more of a starting point > >>>> into Ceylon actually) regarding this topic: > >>> There was a time where PHP was considered a good beginner's language. > >>> Now it seems we want to pivot and target category theory PhDs instead= ? > >>> :) > >> > >> A language that is usable primarily by beginners will only be useful > >> for beginners. Non-beginners will shun it, or simply grow out of it > >> and leave. > >> > >> A language that is usable only by PhDs will be useful only for PhDs. > >> Beginners won't be able to comprehend it. > >> > >> A language that is usable by both beginners and PhDs, and can scale a > >> user from beginner to PhD within the same language, will be used by bo= th. > >> > >> Doing that is really hard. And really awesome. And the direction PHP > >> has been trending in recent years is in that direction. Which is > >> pretty danged awesome. :-) > > > >I would argue that PHP was already doing that almost since inception. > >I think we have ample evidence that we've been seeing a lot of > >different types of usage - both beginners' and ultra advanced going on > >in PHP for decades. > >I would also argue that in recent years, the trending direction has > >been focusing on the "PhDs", while neglecting the simplicity seekers > >(which I wouldn't necessarily call beginners). Making PHP more and > >more about being like yet-another-language, as opposed to one that > >tries to come up with creative, simplified ways of solving problems. > >Last, I'd argue that a language that tries to be everything for > >everybody ends up being the "everything's and the kitchen sink", rather > >than somethings that is truly suitable for everyone. > > > >We also seemed to have dumped some of our fundamental working > >assumptions - that have made PHP extremely successful to begin with: > > > >- Emphasis on simplicity > >- Adding optional features makes the language more complex regardless > >of whether everyone uses them or not > > > >It does seem as if we're trying to replicate other languages, > >relentlessly trying to "fix" PHP, which has been and still is one of > >the most successful languages out there - typically a lot more so than > >the languages we're trying to replicate. > > > >Zeev >=20 > I agree with Zeev 100%. There are too many people out there who are tryin= g > to make the language more complicated than it need be just to prove how > clever they are. The aim of any language should be to enable programmers = to > do complicated things in a simple way, and not to do simple things in a > complicated way. >=20 > I have been programming for over 30 years, so in no way can I be classed = as a > newbie. PHP is my favourite language because of its simplicity. I started= with > PHP 4, and although I have upgraded to PHP 5 I refuse to use any of the > "clever" additions which have been made to PHP 5 simply because I can > achieve what I need to achieve WITHOUT using any of those additions. >=20 > I will not be making use of any changes that are made to the language in = order > to handle typed variables for the simple reason that PHP was specifically > designed to be an untyped language, and in the 13+ years that I have been > programming with PHP I have found that to be more of an advantage than a > hindrance. Tony, I think this is taking the discussion a bit in the wrong direction. I, for one, certainly don't think that our problem is people who want to pr= ove how clever they are, and I do believe that people who are proposing add= itions and improvements to the language are doing it because they think it'= s a good thing. That does not mean it is though. I am also saying that generally speaking, most people who are on internals@= are biased through self-selection towards change. People who are just hap= py the way things are, are unlikely to be on internals and are unlikely to = want to contribute. Fixing bugs, meticulously optimizing performance while= maintaining compatibility, these things get a LOT less interest and aren't= main attraction points for joining internals. Incidentally, they're also = the things that the vast majority of users want the most. As a whole, people don't realize that PHP does not need fixing. I'm NOT sa= ying it's perfect and that it cannot be improved - of course it can - but I= am saying that it's not broken; In fact, it's remarkably successful the w= ay it is, and in fact, we have no evidence that since the RFC process was e= mbraced and language-level features started making their way into it on a m= uch faster pace - anything changed for the better in terms of popularity. = People arguing to introduce radical changes to it (and making PHP a lot mor= e of a typed language, optional or not, absolutely constitutes a radical ch= ange) should realize that it's not risk-free, and given that they tend to b= e advanced, top 5-10% coders - that they're catering not to just coders lik= e them, but also the rest of the 90-95% of the world. Introducing new syntax to PHP, with new semantics, adds a lot of cognitive = load no matter how we spin it. Given how easy it is now to propose an RFC,= and the general bias-for-change of internals, we're now doing this at a re= markable pace, with very few checks and balances. Every feature is evaluat= ed context-free, on whether it's useful in some cases yes/no, and without t= aking into account in any way that 'less is more'. Just see how much discu= ssion we're seeing here about open questions in this typing discussion. Wh= atever decision we take in each and every one of these discussions - means = added cognitive load, as by definition that decision wasn't an intuitive on= e, but one that required much discussion, debate and sometimes compromise i= n order to reach. Zeev