"Without the special @Template comment, Symfony does not know where to find the template file."
First off, this is completely false. With symfony2 the action needs to return a Response object. This annotation isn't required and the team I work with, we rarely use this.
It's very useful for when you are just adding a page that contains no real business logic.
"Doctrine 2 does the same thing when declaring object properties based on database table columns1:"
Oh look, there's a footnote.
"Fortunately, Doctrine also allows you to declare property metadata using PHP, YAML, or XML"
What?
"Because code comments should never be necessary for a script to function properly"
So your points are that we need @Template annotation to be able to render a template, which is FALSE, and you state the same with with Doctrine2 which you point out there are other ways to do it.
All your points for "DX Regressions" are completely wrong.
Unless I am using a special plugin with my IDE it's not going to link "AcmeBlogBundle:Post" to src/Acme/BlogBundle/Entity/Post.php. Most of what you point out is complete bullshit. What do I gain to hope by using var_dump() on an annotation? I know that in a Doctrine Entity that the column type is a string.
Articles and posts like this drive me banana's with the complete lack of understanding what you're writing about.
> First off, this is completely false. With symfony2 the action needs to return a Response object. This annotation isn't required and the team I work with, we rarely use this.
Correct. But if you want use the form where you just return an array of variables to use inside your template, and have Symfony smartly located the template for you, you have to use an annotation. See http://stackoverflow.com/questions/12922827/symfony-2-php-te... for an example.
> and you state the same with with Doctrine2 which you point out there are other ways to do it.
Yes, there are other BETTER ways to do it. Making comment-based annotations available as one of the ways pretty much guarantees that people will use it, and that seems like a bad idea to me. Just remove them so no one is able to choose the bad practice.
> All your points for "DX Regressions" are completely wrong.
Uhh, OK? How about comment folding in text editors? Would you, as a developer, be happy if you encountered some code that made heavy use of annotations for critical application logic? I wouldn't--this is what I mean by DX.
> What do I gain to hope by using var_dump() on an annotation?
The same thing you gain by var_dump()ing any variable--an understand of what's happening under the hood.
> Correct. But if you want use the form where you just return an array of variables to use inside your template, and have Symfony smartly located the template for you, you have to use an annotation. See http://stackoverflow.com/questions/12922827/symfony-2-php-te.... for an example.
Your point is that this is required, it's not. Using annotations is optional. The user you point to in the example wanted to use the annotations and wanted to use php templates.
The FACT is that in Symfony2, your Action MUST return a Response object. Using annotations is an easy way to get around this.
> Yes, there are other BETTER ways to do it. Making comment-based annotations available as one of the ways pretty much guarantees that people will use it, and that seems like a bad idea to me. Just remove them so no one is able to choose the bad practice.
Why is this a bad practice? Everything I need to now is right there in the annotation. I know that it's a string, integer, or anything else. I don't need to open up another file to check.
> Uhh, OK? How about comment folding in text editors? Would you, as a developer, be happy if you encountered some code that made heavy use of annotations for critical application logic? I wouldn't--this is what I mean by DX.
... You can't unfold them? You mean to tell me that having an editor that folds comments is bad design for the software that uses annotations? I'm trying to figure out this critical application logic you speak of. If I'm using annotations to describe a column that is a "string" type and has a length of "32" then what is the difference of it's in a yml or xml file? I enjoy being able to tell that as well as what relationships there are.
> The same thing you gain by var_dump()ing any variable--an understand of what's happening under the hood.
Again, why are you trying to var_dump something that has no value in using a var_dump on? An example of using var_dump and it being useful is "var_dump($user->getSomeRandomCrap())". It tells me what is returned by that method. Is an object or something else returned. WHY DO NEED to var_dump "@Column(type="string", length=32)"? I know the property should be a string and should be a max of 32 characters long?
First off, this is completely false. With symfony2 the action needs to return a Response object. This annotation isn't required and the team I work with, we rarely use this.
It's very useful for when you are just adding a page that contains no real business logic.
"Doctrine 2 does the same thing when declaring object properties based on database table columns1:"
Oh look, there's a footnote.
"Fortunately, Doctrine also allows you to declare property metadata using PHP, YAML, or XML"
What?
"Because code comments should never be necessary for a script to function properly"
So your points are that we need @Template annotation to be able to render a template, which is FALSE, and you state the same with with Doctrine2 which you point out there are other ways to do it.
All your points for "DX Regressions" are completely wrong.
Unless I am using a special plugin with my IDE it's not going to link "AcmeBlogBundle:Post" to src/Acme/BlogBundle/Entity/Post.php. Most of what you point out is complete bullshit. What do I gain to hope by using var_dump() on an annotation? I know that in a Doctrine Entity that the column type is a string.
Articles and posts like this drive me banana's with the complete lack of understanding what you're writing about.