About Symfony: Stability over Features

Fabien Potencier

April 15, 2013

I know that this post won't please everyone, but I'm convinced that this is the right thing to do now and I think that most of the Symfony community will love it. Also, I've tried to be subtle in choosing my words, so read carefully and don't over-read what I've written.

Long story short: in the coming months, the Symfony core contributors should focus their efforts toward stabilizing the existing features instead of working on new ones. At this point, backward compatibility and stability are more important than everything else.

Symfony is one of the few PHP projects that has been promoting radical changes to the way developers work with PHP by leveraging many concepts, best practices, and design patterns from other languages and technologies. But Symfony is also one of the few to embrace true collaboration and sharing. That was not necessarily incompatible in the "early days" of Symfony2, but to continue doing both the right way, the community needs to slightly change its priorities.

To start easy, let's see what stabilization means for me:

  • Refactor less: We need to stop doing refactoring code for the sake of it. Sometimes, our code is not the best architected one, sometimes we could simplify some code, or make it easier to read, but if it does not make things easier for our users, we should avoid doing refactoring.

  • Fix more bugs and edge cases: Symfony has twenty-plus components, small and large, and we are commited to maintain them in the long term. And working on fixing bugs that people encounter or fixing edge cases is a must. Most developers prefer to work on new features rather than fixing bugs, but personnally, I do like fixing bugs because most of time fixing a bug is a challenge... and we like challenges, right?

  • Write more tests: Symfony2 has many unit tests but we need more. We need to write tests that cover bugs and edge cases that we fix, but some parts of the framework are not well tested enough.

  • Write more documentation: Thanks to a great doc team, Symfony2 documentation is really good and it is updated and improved every single day. We should continue this work and the more people helping, the better. The good news is that everyone is able to contribute here.

  • Stop breaking backward compatibility: This is the most important topic and I know that many core contributors are nervous about this one. When we break backward compatibility, we are breaking the Symfony2 ecosystem at large. So, except when fixing a security issue, we must not break backward compatibility anymore after Symfony 2.3 and until Symfony 3.0.

Let's take some examples to make things clear.

What about fixing a wrong or stupid behavior on an existing feature? As we cannot break backward compatibility, and because people might rely on the current behavior, we should add a way to do the feature the right way instead and thoroughly document both behaviors by emphasizing the right way and by deprecating the wrong way until Symfony 3.0.

What about renaming a miss-named thing? We cannot rename the method/class/function/namespace/whatever, but we can add an alias and deprecate the wrong one, which will be removed in Symfony 3.0.

What about a new feature then? Of course, we will still add new features. If it does not impact the stability of the framework, that's fine: adding the new table helper for the console is a great example for instance, or supporting PIDs in the process component. But I believe that we already have a solid set of features that can be used to solve many complex web problems. And most of the time, for features that we don't have, there is already a good PHP librairies that we should leverage instead.

What about adding a new component? Again, that's still possible either by extracting code from other components (like we did for the new Debug component in 2.3 -- and without breaking backward compatibility), or by adding new ones, but that should not be our priority for the coming months.

Stability is also a great enabler:

  • Enhance performance: I'm not talking about micro-optimizations here, but performance on real projects. It was not really practical until now because Symfony2 was a moving target, but stabilization will enable us to make performance test beds and benchmarks to ensure that performance improves with new releases.

  • Convert more projects: I'm really happy that so many Open-Source projects rely on Symfony one way or another, but we need to convert more. By promoting sharing, we also promote reusability and compatibility between many different PHP projects, and that's a very good thing to do.

  • Convert more "corporate" users: When working in big companies, you need to plan your work ahead of time and for many years. So, you can only work with librairies that are maintained and stable in the long term.

I also want to point out that I've tested this approach with Twig. Twig version 1.12.3, released last week, is enterily backward compatible with Twig 1.0, released two years ago (to be fair, we made one mistake in 1.2 if I remember correctly). Of course, Twig is much smaller than Symfony, but if you take each Symfony component as an individual library, then the same approach can be applied. Last year, I started to work on Twig 2.0 because I thought that introducing some great features was not possible with the current architecture, but with some more work, I did introduce everything I wanted in Twig 1 without breaking backward compatibility. That's a big win. And that's probably one of the reasons why so many projects plan to use Twig nowadays (Drupal, eZPublish, Magento2, ...): Twig evolves fast but in a stable way. By the way, that's why namespaces won't be introduced in Twig anytime soon: we don't have a need for them.

At this point, I should probably answer one question: when will Symfony3 be released? As you might have guessed now, there is no plan or schedule for Symfony3; so it's not going to be released anytime soon. We do have an UPGRADE file for Symfony3, but only because we need to reference deprecated features that will be supported for all 2.x versions but that will be removed for Symfony3. And these deprecated features won't trigger any deprecation messages until we have a plan for Symfony3. So, you can upgrade to the new way, but not doing so won't affect you at all.

I hope that this strategy won't slow down the number of contributions. I believe that it will ease the adoption of Symfony2 and I believe that it won't stop us from innovating. And by making a stronger contract with our users, we are opening great opportunities for the Symfony ecosystem: bundles, libraries, projects, frameworks, CMSes, e-commerce solutions, ...

To conclude, think of Symfony as being a PHP middleware instead of a PHP framework and everything should click. This is just the beginning of the Symfony story, let's make it strong and awesome together.

Discussion

gravatar Lukas Kahwe Smith  — April 15, 2013 12:03   #1
Also note that while this means we will be a bit constrained with what we can do inside core, there is still a lot of room for improvement and innovation in the stack on top of Symfony2. related to this see http://pooteeweet.org/blog/2205
gravatar Florian Klein  — April 15, 2013 13:33   #2
s/depreated/deprecated/
gravatar Edwin Hermans  — April 15, 2013 13:59   #3
+1
gravatar Gaetano Giunta  — April 15, 2013 14:09   #4
+1
gravatar Leo P  — April 15, 2013 16:40   #5
+1 , and also fully support the point in Lukas' article.
gravatar Mathias Verraes  — April 15, 2013 22:47   #6
This is the sort of leadership that made Symfony great :-)
gravatar Hugo Hamon  — April 16, 2013 19:30   #7
Nothing more to say and I think this is why Symfony remains the best of all PHP frameworks.
gravatar Luciano Mammino  — April 18, 2013 00:50   #8
Totally agree!
gravatar Javier Marcon  — April 18, 2013 13:49   #9
It is good to hear that Symfony will have more backward compatibility, because many of us are still using Symfony 1.4 and avoiding the use of Symfony 2 (or searching for another framework with full backward compatibility) because there is no easy migration from sf 1.x to 2.x.
gravatar Symfomany  — April 18, 2013 16:02   #10
Awesome article! Symfony is now a PHP middleware instead of a PHP framework
gravatar Daniel Ribeiro  — April 19, 2013 15:00   #11
+1
gravatar Francesco Donzello  — April 21, 2013 10:08   #12
+1
gravatar Mikael Ohlsson  — April 21, 2013 21:38   #13
+1
gravatar Yosvel Quintero Arguelles  — April 22, 2013 03:35   #14
+1 and also agree for the best of Symfony!
gravatar Paulo Vitor S Reis  — April 22, 2013 14:11   #15
+1
gravatar Raphael Schumacher  — April 24, 2013 22:40   #16
+1 for Lukas' statement to innovate "on top of Symfony 2" like RAD!
gravatar FOUAD YAMANI  — April 25, 2013 19:16   #17
+1
gravatar Martin Hlavá?  — April 25, 2013 22:28   #18
+1 Great news! I think most of new features should be introduced with bundles and components.

Problem with migrating from Symfony 2.0 to 2.1 forced some people to stay on Symfony 2.0. I hope this will help symfony as it will allow developers to upgrade their framework easily.
gravatar Behrooz Afghahi  — April 26, 2013 02:01   #19
+1
gravatar Skander MABROUK  — April 26, 2013 15:50   #20
Now that's a real strategy. We must never repeat the mistake of passing from symfony 1.x to 2.x. You must know that until today many companies still using symfony 1.4 to create new projects because they do not have time to learn Symfony2.

Excellent strategy and personally I adopted!
gravatar Marius Bal?ytis  — April 26, 2013 22:03   #21
I don't think that passing from symfony 1.x to 2.x was a mistake - it's completely different frameworks, I don't think that any of the code is the same in these frameworks. 2.x would be never that good if leaving compatibility with 1.x - this was not even possible.
gravatar Michael Cullum  — April 28, 2013 16:49   #22
+1 but it would be nice to see a Symfony 3.0 branch created in the Symfony repository, even without any plans as to when it will be released.
gravatar Nicolas Pastorino  — April 30, 2013 18:02   #23
This move makes total sense in the frame of making Symfony2 a stable, reliable yet rich base for the Enterprise-grade Open-source projects now building on top of it.

As i understand it, this will not hinder innovation in any manner, rather boost it on a mid-term. Also a great way to get neighbor communities even closer and nurture cool exchanges.

Keep going Symfony community,
Love from the eZ Publish community,
gravatar Jonathan Nieto Lajo  — May 10, 2013 12:45   #24
+1 to the post. Cannot agree more.
gravatar Marc Morera  — May 14, 2013 18:55   #25
As is said by Mr Mathias Verraes, we are proud of you Fabien.

Symfony2 is more than just a Framework... is a way of thinking, a great community, a way of life.

Keep doing as usual.

+1 for this post. Interesting as always :)