Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52290 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84117 invoked from network); 11 May 2011 11:31:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 May 2011 11:31:53 -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.42 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.42 mail-qw0-f42.google.com Received: from [209.85.216.42] ([209.85.216.42:51526] helo=mail-qw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D7/46-45512-7A37ACD4 for ; Wed, 11 May 2011 07:31:52 -0400 Received: by qwi4 with SMTP id 4so218713qwi.29 for ; Wed, 11 May 2011 04:31:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=dcSq6/UnLvZxnl3cAKkKRmHAo27D9zVDZNpiRLrWqzc=; b=crGP27T1oi6L6uli9pDbxruaN/er8QMEJFUxrWdC6r0XYbZxkfykmvMYQHgo/gAjYO G8Wf3B9ILjz/2trtlCWErCNCbcr6qoP799dzJ3svrVLoDLSZeYuk4NNC+CFwotZFvP0F AJ+iocEwSW4bkBmb8l12kaU10jHx5aAVs21hA= 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=ao2yCFEPIPmjMdnlVOKuuH4PKO6O2Y4PfmPgxN/vFUmgx3fTNRpeuEjzR0UyfzvWsZ cC1qPuX10mz3m9pH5SKCb65l/KKtkJ2bQhyvsaWUc6OEZXLSPjSiPaYgtyhyZnQcfx8V GvLOCldy/RPhFdzYQk9OV9siPi7jseLFyp8Zs= Received: by 10.229.114.194 with SMTP id f2mr7090436qcq.112.1305113509149; Wed, 11 May 2011 04:31:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.81.212 with HTTP; Wed, 11 May 2011 04:31:28 -0700 (PDT) Reply-To: RQuadling@GMail.com In-Reply-To: References: <4DC729EE.9090600@sugarcrm.com> <4DC75FFF.40008@lerdorf.com> <4DC7A7F0.4000504@sugarcrm.com> <4DC819D0.5010008@lerdorf.com> <4DC81ED6.1050902@sugarcrm.com> <8757232E56758B42B2EE4F9D2CA019C9013F9F59@US-EX2.zend.net> <4DCA2192.4080201@lsces.co.uk> Date: Wed, 11 May 2011 12:31:28 +0100 Message-ID: To: dukeofgaming Cc: Lester Caine , PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] annotations again From: rquadling@gmail.com (Richard Quadling) On 11 May 2011 07:50, dukeofgaming wrote: > It is really troubling to read that statement. Seems there are still some > that don't really have a clue of what annotations are, even when the RFC > clearly links to them. Annotations ARE NOT documentation; in the case of > PHP, documentation is being used as annotations because there is no langu= age > implementation, which exists in other languages (Java, .NET) and they are > widely used. Also, some use annotations as documentation (e.g. store the > class version), but again, annotations ARE NOT documentation. Don't let t= he > "@" notation shared with docblock fool you. > > Guilherme, I think its easy to assume that people already have some sense= of > what annotations are, but perhaps the wiki entry could be more educationa= l > about it?. The first time I read about annotations it was from this link: > http://download.oracle.com/javase/tutorial/java/javaOO/annotations.html; > perhaps an intro like that could help to make the case for annotations > crystal clear?. I'm guessing experience and interpretation is everything here. From reading the Oracle page, to me, it seems annotations ARE documentation. It just depends upon who or what is reading them. The first line of the page ... "They have no direct effect on the operation of the code they annotate". In other words, annotations are just like comments. At least in terms of what I understand the "compiler" does and what the "runtime processing" does. The use of the @ isn't a fooling (according to Oracle) ... "The use of the "@" symbol in both Javadoc comments and in annotations is not coincidental=E2=80=94they are related conceptually.". What I can't see from the link is _WHY_ annotations can't just be docblocks? Annotations and comments don't affect the code. Annotations and comments would need to be parsed to read them. I understand that caching of the annotation could be an issue. And this leads to a gap in my knowledge/understanding. Why does _this_ script need to know anything about its annotations? Especially as "They have no direct effect on the operation of the code they annotate". It would seem wasteful to process dead data for no purpose in _this_ script. It only seems useful for some sort of external process reading the annotation/comment (say a documentor or a tool to build code for runtime operation). In those cases, these are one offs (ish), so caching would not seem to serve any real benefit here. Whilst I think the syntax of the annotation may be worth discussing, the annotation can surely only exist in a comment, at least with regard to PHP. And I'm guessing that the primary use of annotations within PHP would be in runtime processing, so is this really about the parsing of docblocks. I think using PHP code in a docblock (with the appropriate tag ... @annotation maybe) would cover the requirements. Possibly. Due to phpdocumentor not being updated to handle namespaces yet, annotations are also not going to work correctly there. Richard. --=20 Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY