CoC

Speaking of symfony, I’ve found it’s “convention-over-configuration” approach a little maddening. There’s zillions of directories. Many of them have the same names but are along different paths. This one tripped me up today.

Configuration Principles in symfony

For many symfony configuration files, the same setting can be defined at different levels:

  • The default configuration is located in the framework
  • The global configuration for the project (in config/)
  • The local configuration for an application (in apps/APP/config/)
  • The local configuration restricted to a module (in apps/APP/modules/MODULE/config/)

Yes, three levels of config folders on top of the default (which is hidden deep inside of /lib where it belongs). That’s a good thing in that it allows for a lot of modularity and module-specific behaviors. But it’s a bad thing when you edit the file at the wrong place in the hierarchy as I did today. SVN helped me bail out of that particular fuck up.

I like the CoC approach – not being a trained programmer I do things intuitively and defining conventions is a very intuitive approach. Just takes a little pattern recognition to see what’s going on. Humans are good at that. The flip side is that convention over configuration is a my way or the highway proposition. If you don’t like it you may want to keep hacking your own code or maybe use Zend Framework which is not convention-driven.

So, I’m hanging in there with symfony after two days. It’ll probably take a month before I either jump all in or give it all up. We’ll see which.

Tags: , , ,

Leave a Reply