4 ms·
Every time I see an article about new features in PHP I search the page for the "annotation" keyword. To be honest I find it a little bit puzzling that to this
by esistgut 7y ago
Every time I see an article about new features in PHP I search the page for the "annotation" keyword. To be honest I find it a little bit puzzling that to this day a large part of the ecosystem (Symfony, Doctrine, API Platform) revolves around docblock annotations.
- fraktl 7y agoAgreed. Personally, I hate annotations. This is the reason why I never bothered with any tool in PHP ecosystem that relies on annotations. It looks ugly, it feels ugly, it doesn't fit with my mental model - I avoid it entirely.
- flir 7y agoAgree so strongly. Executable comments. Whose bright idea was that?
- move-on-by 7y agoI love annotations - but only at a language level. Annotations being hacked in through comments is a dirty and I do not like it.
- rawfan 7y agoMaybe check out Laravel. They banned all annotations from the framework. Best decision ever.
- larzang 7y agoEverything in the Symfony/Doctrine ecosystem that uses annotations does so as an option for those who prefer them. If you don't like them, you can usually just as easily use YAML or XML or PHP configuration. Most developers seem to like them (brevity, locational grouping of concerns), so they tend to get treated as a default, but they're not the only option or the only one treated as a first-class choice. Like much of new-PHP, this also seems to be something largely borrowed from the Java world, it's hardly something new or invented by PHP.
- esistgut 7y agoDoctrine is deprecating YAML support. As you said docblock annotations are treated as default. I would like to add that this is so true by a large margin. To the extend that using alternatives feels like an (undocumented) extra step. To clarify my previous statement: I like annotations. I just don't like how a large part of the community is forced into the docblock hack.
- krick 7y agoHonestly, Symfony & Doctrine are fucked up and overrated anyway, so, sepite them being very popular, I wouldn't use them using some weird feature as an argument. I'd like to see some annotations like in Python, though.