Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50246 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69255 invoked from network); 16 Nov 2010 12:33:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Nov 2010 12:33:11 -0000 Authentication-Results: pb1.pair.com header.from=rquadling@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=rquadling@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rquadling@gmail.com X-Host-Fingerprint: 209.85.216.170 mail-qy0-f170.google.com Received: from [209.85.216.170] ([209.85.216.170:51238] helo=mail-qy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E4/30-64124-60A72EC4 for ; Tue, 16 Nov 2010 07:33:10 -0500 Received: by qyk8 with SMTP id 8so625196qyk.8 for ; Tue, 16 Nov 2010 04:33:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:reply-to :in-reply-to:references:from:date:message-id:subject:to:cc :content-type:content-transfer-encoding; bh=Ro3VkXcrFlGJ78547P/rC6V306JyW/i5iVUgBlT7Vb0=; b=Tm8Q1WvncCtD+BZcAp/ERd+/q8Y0TJfMK/i+EGTPdFpdptcCBSx3gKH2OYHIlQ6xcn 5TLpKN/G73rnQHskcvj5M61mTQWiz6edlZSGmhbkW83fxpWzljaG3d9jy3uEZEEYUxnm nK95PwIJ1pkyjkVaviCcMLrShlbc4cc8xA1GA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; b=fUZ5QcJt3Qz5vXsl5QT0/u9Bd3OVJsoPVS0f52aWkiH/IHK7UJSXXH/ofOMMc2e8mG jOLHRxbqlPxs33Po58bP6XPWRuR4p79q17/vMbZrB4vbzLMntYc8QD7ckb/MdyHuRudk YFMzlskgysWzOmfUxNxHIW5Kpk7olYPDG4um8= Received: by 10.229.224.201 with SMTP id ip9mr6280983qcb.16.1289910787282; Tue, 16 Nov 2010 04:33:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.100.84 with HTTP; Tue, 16 Nov 2010 04:32:46 -0800 (PST) Reply-To: RQuadling@googlemail.com In-Reply-To: <887FE7CFF6F8DE4BB3A9535F53AFD06A2C59D788@il-ex2.zend.net> References: <887FE7CFF6F8DE4BB3A9535F53AFD06A2C59B588@il-ex2.zend.net> <887FE7CFF6F8DE4BB3A9535F53AFD06A2C59B6A0@il-ex2.zend.net> <887FE7CFF6F8DE4BB3A9535F53AFD06A2C59D788@il-ex2.zend.net> Date: Tue, 16 Nov 2010 12:32:46 +0000 Message-ID: To: Zeev Suraski Cc: Pierre Joye , "guilhermeblanco@gmail.com" , PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] PHP 5.4 - Meta attribute (aka. Annotations) support discussion From: rquadling@gmail.com (Richard Quadling) On 16 November 2010 07:06, Zeev Suraski wrote: >> -----Original Message----- >> From: Pierre Joye [mailto:pierre.php@gmail.com] >> Sent: Tuesday, November 16, 2010 1:45 AM >> To: Zeev Suraski >> Cc: guilhermeblanco@gmail.com; PHP internals >> Subject: Re: [PHP-DEV] PHP 5.4 - Meta attribute (aka. Annotations) suppo= rt >> discussion >> >> On Tue, Nov 16, 2010 at 12:39 AM, Zeev Suraski wrote: >> > Suggesting phpdoc is used for the purposes mentioned does not mean we >> don't understand what we're talking about. >> >> I feel like you never used annotations in other languages, did you? > > You got me... =C2=A0But as an intelligent human being I'd like to think I= can evaluate the merits of a feature without having to actually use it. > > I'm not saying that annotations don't give you any value. =C2=A0Sure they= do. =C2=A0I'm saying that they come at a great price of adding an obscure = branch of syntax into a language that's already grown significantly in comp= lexity, and the bang for the buck isn't worth it. =C2=A0Those advanced deve= lopers needing that feature can make do with phpdoc. > > Zeev Hi all. I use PHPDoc. I develop SOAP services and use ZF to autocreate my WSDL files. I've used tools to create classes from a WSDL file. I don't know how this qualifies specifically as "annotations" - so I'm probably in the same camp as Zeev on this. An issue for me is the lack of ongoing development (it seems) of phpdoc. Yes, sure, it is for documentation. But that is just one sort of annotation. [1] I think having a mechanism which is easily understood in both human and machine terms and obeys a simple, expandable syntax, then this would seem to be extremely useful. I like the idea of JSON encoded annotations. JSON is very simple to understand (if you can manually create a nested associative array in PHP, you can create JSON encoded data). I think for more complex annotations, a simple @tag doesn't seem like it is going to be enough. There is no way to nest the tags in any meaningful and validatable way. At least not in a way that is obvious when you read it. Also, for every new @tag, you have to tell PHPDoc to ignore it as it will produces noise. But consider now the amount of PHPDoc blocks out there. A PHPDoc -> annotations converter would have to be developed. Theoretically, one _SHOULD_ be able to do that using a PHPDoc template - I think - not an area I know well. One issue mentioned is that having annotations will have a "performance hit" on PHP. I'm obviously missing something here. If the annotation is in a blockcomment, then that would seem to satisfy the performance issue. Reading the annotation for normal runtime execution would seem wrong. Only as part of reflection or annotation specific access should the block be "decoded" into whatever form is required. So, aren't annotations really just an extension to the docblock decoding aspects of reflection? Do we have a "performance hit" because of reflection? I know I know very little about the impact on PHP, but a simple syntax wrapped in a comment would really seem to be an ideal approach to me. So much so, I'm almost surprised we need anything in the core at all. Regards, Richard. [1] http://en.wikipedia.org/wiki/Annotation#Software_programming --=20 Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY