Re: Annotation PHP 7
| From: | Larry Garfield | Date: | Wed, 05 Nov 2014 16:22:56 +0000 |
| Subject: | Re: Annotation PHP 7 | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-78726@lists.php.net to get a copy of this message | ||
On 11/4/14, 3:31 PM, Stas Malyshev wrote:
Hi!Javascript is a good analogy, actually. It started off as something you stuck in comments to hide it, just in case. But really, no one does that anymore and hasn't for years. Once it became obvious that it was useful, here to say, and any browser anyone cared about supported it directly it became a first-class citizen, without any comment hacks. Annotations have been a comment hack in PHP for a long time now. They've proven their usefulness. Many large projects use them. They've been proven to work. It's time for them to also become first-class citizens where we can all benefit from them in more robust ways, including simplifying the de facto workflow and toolchain. --Larry GarfieldPrimarily, I do not see docblocks as the right place to store class'metadata information. Metadata != Comments. I personally regard this as a kind of superstition. There's nothing wrong with extending what can be in comments. In fact, Javascript was officially "HTML comment" for years, and it didn't prevent anybody from using Javascript. There are instances of significant comments in various environments. Outright refusing comments can be significant is just arbitrarily limiting our options for no reason. I don't say it necessarily the best option, but we should not reject it because "oh noes, significant comments!". It has been done, and it's nothing special, just one of the possibilities