Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44926 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78337 invoked from network); 10 Jul 2009 16:10:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jul 2009 16:10:37 -0000 Authentication-Results: pb1.pair.com header.from=troelskn@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=troelskn@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.220 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: troelskn@gmail.com X-Host-Fingerprint: 209.85.220.220 mail-fx0-f220.google.com Received: from [209.85.220.220] ([209.85.220.220:49229] helo=mail-fx0-f220.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2D/59-37812-CF7675A4 for ; Fri, 10 Jul 2009 12:10:37 -0400 Received: by fxm20 with SMTP id 20so933097fxm.23 for ; Fri, 10 Jul 2009 09:10:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=vbfWkcgtmNoQTq2dghmB2w7MudZ158M5FdnR34m9JVQ=; b=qRFE4YCtTfw+0Rs3Z2HTnqJDGYQBlXpDDTbKBOWwtDwFfaf/jW0VhpRgZlBZYY5KP/ t0sHXlbVI/YGcnRe0xRsiPl9xK9u+bQ9N3S0y/GY4GatVooPexQAAwqaY6564C1BtUYi KtxDcYP5HRzY/uKvoBCuCJ26P7/fMFQCpCqe8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Iq46/baaT327W33RVLcLB+GYgspzP4h1tXSycXVfL2H9HMGPVL2/0P1T4ik13sIyCU Az3IEXydi2lS4piu608pMWIewbpBWPm/59BYoOhBHA7CpWzt9ODg4l41M/wfYAHMWuhj aYw5M6Bv2dTyX1UJbTEVEtjDb9c3B6zp/AEkk= MIME-Version: 1.0 Received: by 10.223.107.199 with SMTP id c7mr1187141fap.31.1247242233538; Fri, 10 Jul 2009 09:10:33 -0700 (PDT) In-Reply-To: <98b8086f0907100512u40b7241dvcdc305315ff4c500@mail.gmail.com> References: <7.0.1.0.2.20090708224156.0ac5a438@zend.com> <98b8086f0907091150r47e7a103jaa50fcf7d5b32186@mail.gmail.com> <4A568B33.9000501@gmail.com> <98b8086f0907091744w7ab598dckc427d0a9484664b2@mail.gmail.com> <20090710102302.GC20283@gerbil.thgnet.it> <4A571981.80900@gmail.com> <20090710110522.GD19636@mint.phcomp.co.uk> <98b8086f0907100512u40b7241dvcdc305315ff4c500@mail.gmail.com> Date: Fri, 10 Jul 2009 18:10:33 +0200 Message-ID: <98b8086f0907100910r1f34805cr54e72a64f790196c@mail.gmail.com> To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Fwd: [PHP-DEV] Type hinting - Request for Discussion From: troelskn@gmail.com (troels knak-nielsen) ---------- Forwarded message ---------- From: troels knak-nielsen Date: Fri, Jul 10, 2009 at 2:12 PM Subject: Re: [PHP-DEV] Type hinting - Request for Discussion To: Lukas Kahwe Smith On Fri, Jul 10, 2009 at 1:40 PM, Lukas Kahwe Smith wrote: > right .. lets not forget the original goal (though it hasnt been perfectly > defined) Good point, clarifying the goal should probably have been done long time ago. I think that some of the reason why this discussion has fragmented and begun to go sour, is that it started with an implementation proposal - not with a problem to be solved. This makes it very hard to agree on anything or even to have a meaningful discussion. So you suggest the following goals: Move common validation code out of the function body in order to * reduce code * increase readability * enable IDE's to be even smarter. That sounds like a good proposal. Now, static typing is one possible solution to that. Contracts is another. I like contracts better, since they focus on the interface rather than on the implementation. I think this is much more in lieu with php's type system. I do agree that moving imperative code into the signature complicates matters and looks rather messy. I don't think that's the case as per my initial proposal however. Now, static typing does provide one benefit over a strictly run-time contract. It enables a more meaningful static analysis of the code. This translates into smarter IDE's and enables certain transformations of source code (Eg. automated refactoring). But they also come at a cost in flexibility, makes the language more verbose and even then, it will still only be a partial solution. Personally I just don't think this price is worth it, just to get smarter IDE's. -- troels