|All about PHP annotations... [message #101789]
||Tue, 29 June 2010 21:49
Registered: January 2006
I'd really like to know opinions of the community about annotations.
My opinion today is pretty much "avoid" them, but I took some time to think about it.
The most annoying con I had was, "something which adds logic to one language entity must be part of the language".
But after watching the last symfony live, I have a pro:
It allows you to write domain objects which wont be aware of what uses you invent. And so, they won't have overhead domain objects couls have before. And you write less code. Easier to write, easier to read, all right! Even more, coupling your domain objects with your beloved orm, with the validation stuff or whatever is past thoughts.
My real question is there.
Is this a real improvement, or is this just some way to avoid real software architecture (you know, simple object composition (http://www.artima.com/cppsource/codestandards3.html), or a deep language improvement but a formal one (i mean, phph should be able to understand it))?
I mean, no offense.
I understand that annotations translate to "less code to write".
And it is good.
But how debuggable this is? PHPDoc is understandable by IDE (of which I don't care since I'm using vim), but will dozens of libraries use their own syntax? Everybody his own language?
Even if I see the advantages, I'd really like to know the community opinion about this, will every php library developper write his own annotation language?
Thanks a lot in advance for your lights.
[Updated on: Tue, 29 June 2010 21:50]
PHP Coder and linux enthusiast