|
|
|
|
|
by blowski
5000 days ago
|
|
What's in the annotation is configuration, not application logic. As such there's no real difference between putting configuration into YML, XML and annotation comments. In response to your 4 specific criticisms:
1. (DX regressions) - in theory yes, in practice the frameworks are good at this. The annotations compile down to PHP which you can look at directly, and you get exceptions if there is something wrong with the annotation.
2. (Decreased readability) - subjective POV. I find it easier, because the relevant configuration is next to the code to which it applies. It also prevents crufty out-of-date comments floating around.
3. (Yet another library) - Yep. No answer there.
4. (Icky feeling) - I get far more icky feelings out of seeing 30 lines of custom written 'setup code'. Annotations help to prevent that. |
|
I've defended PHP for some time now, but this is getting ridiculous.
Isn't PHP embedded inside markup? Wouldn't it be simpler to do something like:
?> < ... XML GOES HERE ... > <?php
and not violate any expectations?