Re: Native Annotation Syntax
| From: | Rowan Collins | Date: | Wed, 25 Nov 2015 17:00:47 +0000 |
| Subject: | Re: Native Annotation Syntax | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-89415@lists.php.net to get a copy of this message | ||
Pedro Cordeiro wrote on 25/11/2015 16:53:
Rowan, even if they are not harder, there is no reason to keep this feature in docblocks.Well, I can think of one reason: backwards compatibility. I don't mean with current frameworks - as you say, these are not currently standardised, so some will need to be adapted whatever is implemented in core - but with older versions of PHP. If we invent new syntax, then any code using that feature must *require* the version of PHP that introduces that syntax, because previous versions will simply throw a syntax error. There are a few ways around this, such as: - allowing the annotation to be preceded by // as Sara suggested (or maybe #, to make it look like a C pre-processor directive) - using some other syntax that is currently a no-op, like ECMAScript's wacky "use strict" But ultimately, these end up having the same disadvantages you're claiming for docblocks - they look like things you can delete, or which has some other purpose, but are actually vital to the operation of the code.# I don't feel that strongly in favour of docblocks, but I don't think the reasons given against are particularly strong. Regards, -- Rowan Collins [IMSoP]