Re: Re: PHP Annotations RFC + Patch
| From: | Gustavo Lopes | Date: | Mon, 13 Sep 2010 16:11:24 +0000 |
| Subject: | Re: Re: PHP Annotations RFC + Patch | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-49626@lists.php.net to get a copy of this message | ||
On Mon, 13 Sep 2010 16:59:13 +0100, Zeev Suraski <zeev@zend.com> wrote:
At 17:51 13/09/2010, Gustavo Lopes wrote:You misunderstood me. When I say the frameworks use annotation I don't mean they use annotations in their own implementation (that's not particularly relevant for the reason you present). What I mean is that the frameworks recognize annotations the application code has so that the framework user can do stuff like injecting objects, run methods in transactions or check post-conditions in a declarative fashion, by adding annotations. By the way, you ignored the rest of the e-mail. How do you evaluate the complexity/return of features such as annotations with that of e.g. LSB? Why are they not adequate for PHP, but may be for other languages? -- Gustavo LopesOn Mon, 13 Sep 2010 16:28:47 +0100, Zeev Suraski <zeev@zend.com> wrote:Framework code (as in code that actually goes into a framework, not code that uses a framework) represents a tiny percentage of the PHP codebase at large. Most of it is application code.At 16:39 13/09/2010, Pierre Joye wrote:Rare use case? Have you seen any recent Java framework? Or Java EE 6? Or design by contract in C#? A declarative programming style can be very handy.You are not serioulsy suggesting to use phpdoc for runtime annotation support? Are you?I actually am (either that or get what you want done in some other way). It's a rare enough use case that I think it's a very reasonable compromise. The disadvantages of adding a whole new branch of syntax, for this rare use case, far outweigh its advantages - IMHO.