Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92375 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6219 invoked from network); 17 Apr 2016 09:19:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Apr 2016 09:19:22 -0000 X-Host-Fingerprint: 80.177.120.119 marston-home.demon.co.uk Received: from [80.177.120.119] ([80.177.120.119:12827] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B3/C7-32052-81553175 for ; Sun, 17 Apr 2016 05:19:20 -0400 Message-ID: To: 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> <571267B4.9070507@thefsb.org> In-Reply-To: <571267B4.9070507@thefsb.org> Date: Sun, 17 Apr 2016 10:19:00 +0100 Lines: 7 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 16.4.3564.1216 X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3564.1216 X-Posted-By: 80.177.120.119 Subject: Re: [PHP-DEV] Re: Improving PHP's type system From: TonyMarston@hotmail.com ("Tony Marston") "Tom Worster" wrote in message news:571267B4.9070507@thefsb.org... > >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. Where is the insult in what I wrote? >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. Where did I ever use the word "incompetent"? You are reading what isn't there. -- Tony Marston