Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67849 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84352 invoked from network); 26 Jun 2013 09:51:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jun 2013 09:51:19 -0000 Authentication-Results: pb1.pair.com header.from=inefedor@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=inefedor@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.47 as permitted sender) X-PHP-List-Original-Sender: inefedor@gmail.com X-Host-Fingerprint: 209.85.215.47 mail-la0-f47.google.com Received: from [209.85.215.47] ([209.85.215.47:63420] helo=mail-la0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 20/10-18025-699BAC15 for ; Wed, 26 Jun 2013 05:51:18 -0400 Received: by mail-la0-f47.google.com with SMTP id fe20so13448555lab.20 for ; Wed, 26 Jun 2013 02:51:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:to:cc:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=j7YkxnBN5JlLibhWKr6zW1OUz14Hp9Z/tkd4elNZnBI=; b=IYjpyhQoHLljCvJf+d9QI/ZDXmasL4XTTTDmQ5Lr5vdnTy9B6GszWFsMQpDFLUSBM1 sj/uLqzeaoXZPdtcaFRXx0fI3iAIAT7gWuZ7+qPAZggK5lurfq/3CdpCOQrJrmvNrCaU ItnWTVH714g+PRBhdo36I6sA17qlnte+TVnHqQLWRJSvP4El0UrYKlCZXoZA0FUFfr+C KzG9uYwt2X90CG/ewqvZwHUiQi0a4bd5rqtFR/AnN+bIJ136C1Ifw11pyRGworz8G/mR JJnMENJVCHen5bs6kD/H6QZRvWhrSfARnsIGFZmTv0fLeqNvuKXse0qLIbi0BRrIhPMA UUWQ== X-Received: by 10.112.144.35 with SMTP id sj3mr1815360lbb.4.1372240275530; Wed, 26 Jun 2013 02:51:15 -0700 (PDT) Received: from nikita2206-n56vj ([217.174.184.92]) by mx.google.com with ESMTPSA id f8sm10229729lbr.10.2013.06.26.02.51.14 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 26 Jun 2013 02:51:15 -0700 (PDT) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Anthony Ferrara" , "Stas Malyshev" Cc: Laruence , "internals@lists.php.net" References: <51CA16C2.2000100@sugarcrm.com> <51CA206A.9050002@sugarcrm.com> Date: Wed, 26 Jun 2013 13:51:13 +0400 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: <51CA206A.9050002@sugarcrm.com> User-Agent: Opera Mail/12.15 (Linux) Subject: Re: [PHP-DEV] RFC: Protocol Type Hinting From: inefedor@gmail.com ("Nikita Nefedov") Hi, On Wed, 26 Jun 2013 02:57:46 +0400, Stas Malyshev wrote: > That means all you really need is to call method named "get", regardless > of what it actually does. Usually the code doesn't work this way - you > expect something to actually happen if you call get(), something > specific. Interface ensures whoever wrote that object acknowledged that > this is what he wants too. But you (as a library dev) still have interfaces. You still use them. This discussion got really big in a short period of time, but we all know all this change does is gives us an ability to not write additional code. Some people already stated it - you just won't need to create adapters and it's cool. There's a lot of cases where you need to wire to different libraries and for that matter you create THIRD library and call it something like %lib1-name%%lib2-name%Adapter where you, in the best case, should create classes that inherit from some lib1's or lib2's classes (and just add "implements Lib2Interface"), or if there's some static methods - you are forced to create decorator which implements needed interfaces - and that is what will give a far more overhead than some runtime engine-level checks. What about static analysis, it just lays on YOUR shoulders, if you so want static analysis to work properly you just write code which implements interfaces. But if it's fine for you, then it's fine, it's easy. PS sorry for caps in some places