Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92370 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64569 invoked from network); 16 Apr 2016 16:26:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Apr 2016 16:26:42 -0000 Authentication-Results: pb1.pair.com header.from=fsb@thefsb.org; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=fsb@thefsb.org; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain thefsb.org designates 173.203.187.123 as permitted sender) X-PHP-List-Original-Sender: fsb@thefsb.org X-Host-Fingerprint: 173.203.187.123 smtp123.iad3a.emailsrvr.com Linux 2.6 Received: from [173.203.187.123] ([173.203.187.123:35047] helo=smtp123.iad3a.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C9/E3-32052-0C762175 for ; Sat, 16 Apr 2016 12:26:41 -0400 Received: from smtp8.relay.iad3a.emailsrvr.com (localhost.localdomain [127.0.0.1]) by smtp8.relay.iad3a.emailsrvr.com (SMTP Server) with ESMTP id 1C5723801A9; Sat, 16 Apr 2016 12:26:37 -0400 (EDT) X-Auth-ID: fsb@thefsb.org Received: by smtp8.relay.iad3a.emailsrvr.com (Authenticated sender: fsb-AT-thefsb.org) with ESMTPSA id 058D6380184; Sat, 16 Apr 2016 12:26:36 -0400 (EDT) X-Sender-Id: fsb@thefsb.org Received: from yossy.local (c-66-30-62-12.hsd1.ma.comcast.net [66.30.62.12]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA) by 0.0.0.0:587 (trex/5.5.4); Sat, 16 Apr 2016 12:26:37 -0400 To: Tony Marston , internals@lists.php.net 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> <9E.60.32052.E3002175@pb1.pair.com> Message-ID: <571267B4.9070507@thefsb.org> Date: Sat, 16 Apr 2016 12:26:28 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <9E.60.32052.E3002175@pb1.pair.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: Improving PHP's type system From: fsb@thefsb.org (Tom Worster) On 4/16/16 5:04 AM, Tony Marston wrote: > "Marco Pivetta" wrote in message > news:CADyq6sJfPYgQvhQt=UvCBqkooJjoUPCz1sUfzwXc+55hL0PpzA@mail.gmail.com... >> >> Tony, that sounds really like "real programmers use `dd -if -of`". Please >> stop with that argument, as it really doesn't reflect reality. > > That is not what I said. As a follower of the KISS principle I believe > that good programmers write simple code that anyone can understand, > while less-than-good programmers write complex code that only a select > few can understand. ...or perhaps nobody can understand. Agreed. So I guess that makes me a follower of the KISS principle too. I prefer boring, obvious, conventional code and the kind of strict style guides that artisan codes hate. I'm also conservative wrt changing PHP -- a gradualist. And I dislike arguments proposing feature X because such-and-such more fashionable language has it. That said... I have found that my programs, my team's and the libs I use are more obvious, boring and easy to understand when they are clear about type. So in recent years I've tried to be more and more rigorous in using PHPdoc2 type tags, the IDE's linters to run static checks, and working towards eliminating using "mixed" and "|" in the type spec. PHP 7.0's type is better than relying on conventional annotations that evolved from a doc generator. I like these specific "shiny new features". I believe that being stricter with type has helped reduce the rate at which we introduce bugs. It's been totally worth it. As I see it, I can't afford not to. So I don't like Union Type because it will encourage sloppy type in libs that I might otherwise want to use. I don't want nullable hints for the same reason. With some reluctance and acknowledging the inconsistency I *do* advocate nullable return because eliminating something or null from PHP conventions seems a stretch and I'd rather these were declared than not. That's just my position. I don't think I'm behaving like an academic researcher or computer scientist with a PhD. I prefer to see myself as a practical computer programmer with a deep concern for long term maintenance of my programs. > The problem with adding all these new and shiny features ... > only for the benefit of the few who think programming should be > restricted to those who have Phd's. I see two problems with arguing along these lines. 1. It's not specific enough. 2. It's a bit insulting both to me and, I imagine, to academics. So please try to be more specific about both what you want and why. At the moment you appear to be arguing against any change to PHP and justifying this with the argument that anyone who wants to change it is an incompetent programmer. Tom