Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why did Symfony 1.x favor convention over configuration but Symfony 2.x the opposite?

Tags:

symfony

I'm honestly not trying to troll. This is a serious question that I imagine almost certainly has a concrete, objective answer.

Symfony 1.x, like Rails, seemed to adhere to the principle of convention over configuration. For example, when you would create a module and then create actions within the module's controller, you didn't have to create new routing rules. Symfony just knew what to do. But now with Symfony2 you have to explicitly create the routes. This is just one example. There are other cases of what seems to be a conscious decision to favor configuration over convention. I'm absolutely baffled as to why.

So my question, again, is: Why did Symfony 1.x favor convention over configuration but Symfony 2.x the opposite?

Sorry if this question is in the wrong place. I suppose it might not be a programming question. If there's a more appropriate place for me to ask this question, let me know and I'll happily move there.

like image 616
Jason Swett Avatar asked Mar 30 '12 15:03

Jason Swett


1 Answers

Symfony2 still favors convention over configuration, but it just got rid of a lot of “magic”, favoring explicit over “magical”. The reason is that “magic” was helpful in simple cases but a lot of confusion and troubles were caused by it in the long run.

And not only Symfony2 did that, but the PHP community in overall. Doctrine 2 did that. Zend Framework 2 is doing that.

like image 92
Elnur Abdurrakhimov Avatar answered Sep 26 '22 07:09

Elnur Abdurrakhimov