Lessons learned from a Symfony2 – Training session

11. April 2011 in Symfony, Symfony2, workshop

I have given my first Symfony2 training session last week. It was a bit short (two-days) but I was able to cover the basic parts of Symfony2. As I have given a lot of symfony 1 trainings in the last three years I was pretty excited how this session will work out. Everything was new, the slides, the samples and of course the framework ;) Here are some facts I learned in this two days:

The good

  1. ASP- and Java-Users love Symfony2 :) Depepency Injection, POPOs, Entity Manager. All these concepts they know can be easily used with PHP.
  2. The new WebTestCase possibilities are incredible. Everyone liked the concept of using BrowserKit and Crawler to test simple webpages. The Usage of PHPUnit instead of
  3. Twig got some positive feedback too. Some didn’t really see the positive effects in using Twig instead of PHP on first sight but after some samples a a quick glance at the possibilities of the included filters and functions most of the attendess were convinced.
  4. Doctrine2 is fast and easy to use. Java-/Hibernate-Geeks had an easy start here because of the familarity of the API
  5. Veteran-PHP programmers without framework experience liked the possibility of MVC, environments etc.
  6. The new security subframework got some very positiv feedback too. Seems a good solution for most of the people

The bad

  1. Lack of documentation at the time of training. This is obvious and predictable. The training was done with PR9 and PR10 of Symfony2. Some of the documentation is pretty good at the moment wheras some is up to none existant or useless. A configuration reference was mostly missed. There are a lot of configuration parameters buried in the depth of Symfony and it feels like no one except of the core member are know how to use them (take a look at this for example: Stackoverflow). The Form-Framework is difficult to use at the moment because of the lacking documentation
  2. Compared with symfony 1 I saw that it is more difficult to get the attendees to a point of initial understanding how a Symfony application is build and working. This is because of the lack of Convention over configuration. At the moment I’m feeling the Configuration over Convention difficult to explain.
  3. The possibility of using different ways of configuration was kind of confusing to some of the attendees. When should I use YAML, XML or annotations? Difficult to get a common understanding on this. This was even worse under the configuration possibilities are not proper documented. Doctrine is a good example here. The Annotations are described in detail but the YAML not. I’m not sure how this will work out for large development teams when some will start to use YAML others PHP…
  4. Best-Practises are missed too. This is also understandable cause ther is no stable version but I think this is something that will take some time (probably until 2.1 or even 2.2). The biggest problem: Where to put the code? Especially database oriented code.

The flexibilty of Symfony2 is incredible but I have learned the last days that this is a high hurdle to take for a lot of developers. Compared with symfony 1 I think the lack of best practises and convention over configuration is the most time consuming part of getting productive with Symfony2. The new possibilities and features of Symfony2 are awesome and it is interessting to see how good some of the existing Bundles already are.

I have two more Symfony2 trainings coming in the next months. Im excited to how Symfony2 will evolve over the time.


1 response to Lessons learned from a Symfony2 – Training session

  1. Great feedback and points – some comments/elaborations:

    * The docs will obviously improve greatly over the next couple of months. The fundamentals – controllers, routing, architecture (the first few chapters of the book) are already quite well-documented. The things that are still being worked on – security, forms (especially) – are lacking a little bit as we wait for their code to slow down. But, I think the Symfony2 docs will ultimately be a major strength.

    * I don’t think configuration over convention is the ultimate goal – more that the framework had to be built first to be completely configurable – then we’ll be adding more configuration so people can get started quickly

    * Best practices are the same way – as we figure them out, we’ll start teaching those specific methods, and leave the other flexible ways for those who want to use them. You hit the issue exactly – people want to know where to put their code, and “anywhere” isn’t exactly the right answer :)

    So yes, I totally agree – it’ll be very exciting to see how Symfony2 evolves over the next few months. I’d love to hear the feedback you continue to get in your future trainings.

    Thanks for the post!

Leave a reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>