Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44643 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28551 invoked from network); 2 Jul 2009 12:53:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Jul 2009 12:53:56 -0000 Authentication-Results: pb1.pair.com header.from=ilia@ilia.ws; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ilia@ilia.ws; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ilia.ws designates 209.85.219.227 as permitted sender) X-PHP-List-Original-Sender: ilia@ilia.ws X-Host-Fingerprint: 209.85.219.227 mail-ew0-f227.google.com Received: from [209.85.219.227] ([209.85.219.227:45846] helo=mail-ew0-f227.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/82-16153-2EDAC4A4 for ; Thu, 02 Jul 2009 08:53:55 -0400 Received: by mail-ew0-f227.google.com with SMTP id 27so1838692ewy.23 for ; Thu, 02 Jul 2009 05:53:54 -0700 (PDT) Received: by 10.210.102.12 with SMTP id z12mr55024ebb.5.1246539233903; Thu, 02 Jul 2009 05:53:53 -0700 (PDT) Received: from ?192.168.1.169? (TOROON63-1176059019.sdsl.bell.ca [70.25.60.139]) by mx.google.com with ESMTPS id 5sm2386675eyh.40.2009.07.02.05.53.51 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 02 Jul 2009 05:53:53 -0700 (PDT) Cc: Paul Biggar , PHP Internals , Derick Rethans , Stanislav Malyshev , Hannes Magnusson Message-ID: To: Lukas Kahwe Smith In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Thu, 2 Jul 2009 08:53:48 -0400 References: X-Mailer: Apple Mail (2.935.3) Subject: Re: [PHP-DEV] Re: Flexible type hinting From: ilia@ilia.ws (Ilia Alshanetsky) On 2-Jul-09, at 4:56 AM, Lukas Kahwe Smith wrote: > > On 02.07.2009, at 10:45, Paul Biggar wrote: > >>> to work in a future with a library/framework that is strict about >>> its input >>> or some far fetched idea that it will change the very nature of PHP. >> >> I don't think we are worried about it changing PHP, or about >> libraries >> using strict type hints. We are worried that libraries will use no >> hints, because the ones on offer are not useful to them. > > > I think he is replying to me here. I am worried that with Ilia's > proposal, people will strictly type everything, even where weakly > typed would suffice. The reason being that developers are lazy. With > these type "hints" (they are not actually hints, but "checks" as you > already made clear), they can very easily move the burden of type > juggeling explicitly to the user of their code. > > At least in my world, I use a lot of 3rd party libraries, which will > then likely become essentially strictly typed. While strictly typing > can prevent bugs and all sorts of good stuff, we should be more > hesitant when it comes to giving people tools that make it easy > (encourage) to turn a core principle of PHP upside down. First of all PHP is a tool, if some developers choose(!!) to adopt stricter practices (which I doubt will happen), then perhaps its time for the tool to change with them. As far as I know PHP is there to solve problems and make it easy to do so, not support/enforce certain programming paradigms. > I know that "numeric" was a concession to people with my concern > from the last discussion. But it doesnt cover all the bases of > types. In that vain Paul's proposal does indeed provide a syntax > that at least enables both approaches. More importantly it proposes > a syntax that requires the same number of characters for both > approaches. You might laugh at this comment, but I believe that the > overuse of "private" that I am seeing has a lot to do with the fact > that its shorter than "protected". Paul's proposal is some part does not make sense because it allows weak type hinting, which should not be used if you need type hinting. The whole idea about type hinting is definition of strict interfaces, not loosely based one. That's just my opinion, which admittedly I feel fairly strongly about. Ilia