Why Symfony?

Fabien Potencier

September 07, 2012

Yesterday, Zend Framework 2.0 and Symfony 2.1 were released... almost at the same time. First, I want to congratulate the Zend Framework team for this huge milestone; I know that working on a new major version is no small task.

And of course, people started to ask questions about these new versions and one of the most popular was: "Why would I choose framework X over framework Y?". As you can imagine, the answer is not that easy as each framework has its own specificities.

I like to think that most popular frameworks are modular enough, fast enough, well-documented enough; they are using well-known design patterns. So, besides the buzzwords, what is unique to Symfony? Why would you want to use Symfony instead of X (replace X with ZF, CakePHP, Lithium, Laravel, Slim, Yii, you name it)? That's the question I'm going to answer in this post.

So, without further ado, here are my main selling points for Symfony:

  • Symfony is not a framework but a project. Depending on your needs, you can choose to use some of the Symfony Components, the Silex micro-framework, or the full-stack framework.

  • Symfony is used by many large companies (like the BBC or CBS), by many large websites (like TED, wetter.com, Lockers or even YouPorn just to name a few) and some Open-Source projects are also powered by Symfony (CMSes like Drupal or eZpublish, libraries like PHPUnit or Doctrine, products like phpBB or shopware, and even frameworks like PPI or Laravel). This brings a lot of interoperability between all these solutions.

  • Symfony enjoys a huge community of users and contributors; during the last year alone, 550+ people contributed to the Symfony core and the community created over 1,600 bundles for the full-stack framework. Symfony also has several annual dedicated conferences around the world and a large number of user groups.

  • Symfony has been created in 2005 and here to stay. Besides SensioLabs, many other companies rely on Symfony for their clients and they contribute, invest money, and sponsor the future of the project.

  • Symfony embraces the "don't reinvent the wheel" philosophy, and provides tight integration with many other Open-Source projects (like Monolog, Assetic, Doctrine, Propel, ...).

  • Symfony tries to bring innovation to PHP: it was one of the first major frameworks to embrace PHP 5.3, to introduce the usage of a Dependency Injection container, and to use a templating engine for its templates by default, Twig, which is now also adopted by major CMSes like Drupal and eZpublish. Symfony also has some unique features like its gorgeous debug toolbar and its great built-in profiler.

If you think I've missed some important selling points, feel free to list them in the comments and in a few days, I will aggregate everything in a new page that will be hosted on symfony.com to help users make an informed decision when choosing a framework.

And if other frameworks would like to do the same, I would happily add links to their pages on the Symfony one, and if in turn, they do the same, that would create a ring of links that will ease the choice of a PHP framework for developers.

Discussion

gravatar Dominik Zogg  — September 07, 2012 11:35   #1
Hello Fabien

Great post, cause its based on facts and doesn't bash others.

Regards Dominik
gravatar Roman Marintsenko  — September 07, 2012 11:40   #2
You forgot to mention that Symfony community members were the first to embrace and take a large part in development of awesome tools - Behat and Composer. :)
gravatar Roman Marintsenko  — September 07, 2012 11:53   #3
.. Also on the point of "don't reinvent the wheel" - Symfony community reuses things even from other languages with stuff like Capifony (extension of Capistrano, which written on Ruby).
gravatar Tobias Nyholm  — September 07, 2012 11:54   #4
I think you should mention the CLI. With just a couple of commands you could define your database schema and create forms, create, update and read actions and templates. Now you just need to add project specific logic. I think that is one of the best features of Symfony.
gravatar Alexander Makarov  — September 07, 2012 12:10   #5
He-he. Almost all these arguments are valid for ZF2 as well:

- ZF2 components are OK to use without the framework itself.
- No doubt that ZF2 will be used by many large companies and OpenSource projects. Since both ZF2 and Symfony2 are PSR-0.
- ZF2 community is large as well. Contributors are very good. Conferences are there. I know no PHP conference when there are no ZF talks (or ZF mentioned in talks).
- Zend is definitely here to stay.
- ZF2 brings innovations same as SF2.
gravatar Alexander Makarov  — September 07, 2012 12:12   #6
ZF2 and SF2 are now in the same Enterprise niche. Both are of high quality and complexity and I guess the winner will be determined not by technical perfection but by marketing and enterprise services.
gravatar Franz Liedke  — September 07, 2012 12:13   #7
I agree with Tobias.

The CLI is a good example what is almost completely missing in this list: features.

Community, age (as in mature and here-to-stay), stability, etc.: almost every framework is going to list that, it doesn't really make the framework special. Why not focus on which innovations really make Symfony special from a coder's perspective. The central philosophy when it comes to code and structure, things like that...

Other than that, it's a cool attempt. I hope other frameworks are going to jump in with their lists.
gravatar Fabien Potencier  — September 07, 2012 12:22   #8
Alexander: I've tried to base my list on facts, not on assumptions.

Anyway, feel free to create the same list for Zend Framework as it would help people choose their frameworks more easily. If you list most of the things I've listed here, that's fine too. I didn't said that Symfony was the only PHP framework to have these characteristics. Keep in mind that PHP has hundred or event thousands of frameworks. So, of course, similarities exist between them.
gravatar anonymous  — September 07, 2012 12:24   #9
I would just like to add that Symfony has the best codebase around IMO.
gravatar Alexander Makarov  — September 07, 2012 12:31   #10
Fabien: Sure there are similarities but you're answering "Why would you want to use Symfony instead of Z?" question, not just listing pros of the Symfony itself so it looks like a bit unfair comparison.

I'm not really into Zend Framework, just checking what's happening on the PHP scene from time to time, so I'd better leave building of the pros list to people tightly working with it.

What do you think about Symfony2, ZF2 and the niche these frameworks are now taking?
gravatar thejw23  — September 07, 2012 12:34   #11
Alexander Makarov said what I was about to write: those arguments are valid for other frameworks too. And they are pointless for a developer: why should I care that Symfony was first framework with some feature, if other framework implemented same thing much better and it's easier to develop site with it? Other frameworks also have community, modules, are used on large sites and have been around for a quite few years.

It's all marketing, witch looks just like Fabien was afraid that ZF2 will pull out some users from Symfony community.

Why Symfony, should be a post about what makes Symfony 2.x so special, why developing application with is different (better? easier?) that in ZF2. And all I see is that Symfony if good because... it it good. Not a single argument for a developer wondering witch framework: ZF2 or S2.1 to choose.

Symfony1 vs ZF1 or Symfony2 vs Zf1 is quite easy to say why Symfony might be better for most projects and developers. With ZF2 some of those arguments are not valid any more and it would be interesting to read what Fabien thinks about it, how Symfony make life easier and help build projects faster/better than Zf2.

So far I don't see any reason why Symfony should be better for my project than ZF2, and after creating 1 site in SF2 and looking at tutorials of ZF2 - I guess I will go along with ZF2, it fits into my needs better than SF2.

So, Fabien, Why Symfony, Why... ?
gravatar Fabien Potencier  — September 07, 2012 12:43   #12
thejw23: if you like ZF2 better, that's fine. I'm not trying to convince everyone to use Symfony. I think that I've listed some unique points that are not true (yet) for ZF (a huge number of available bundles, Symfony2 being stable for more than a year now, many large Open-Source projects switching to Symfony, ...), but if you think that they are not relevant for you, no big deal.

And if we want to start talking about features, that's also something we can do, but that was not the goal of this post.

Then again, I don't want to start a flame war between Symfony and Zend Framework. There are many other good frameworks around that you can choose from too.

gravatar anonymous  — September 07, 2012 12:48   #13
I've been using ZF1.x for years. I've been also trying to incorporate ZF2 into existing codebase, but since ZFBeta3 I dropped that and looked into Symfony 2.0.x.

It's been 8 month since I do my stuff with Symfony exclusively. I couldn't be happier.

My selling points:

- ZF2 is too "scientific". You can right a thesis about ZF2 and its design. Don't get me wrong, I love best practices, standards, design patterns etc, but ZF2 devs dive to deep into "science". It is like Minix Vs Linux if you will.

- Symfony's components on the other hand are pragmatic set of tools to get the job done, while embracing same standards/patterns/etc. Routing Vs Router, HttpFoundation Vs Http, Translator Vs i18n to name a few. It just feels easier to use, debug and get the job done. Each time I dive in sf code I wonder how simple and elegant the solution is with arguably less code than for same feature in zf.

- "don't reinvent the wheel" philosophy is not just a bullet point. Thanks to Symfony I discovered so many great libs I've never heard of being in zf ecosystem: Assetic, Imagine, Behat, Twig, Composer, Silex, Monolog Knp stuff and many more.

- I think it is much easier to find a high quality bundle for Symfony than for ZF module/component (I'm referring to zf1 here, obviously zf2 needs to catch up). Almost for any task there is a bundle you can base your stuff on or at least to get an idea how to approach the problem.

- I wrote this above, but can't ignore the existence of Symfony\Component\Form. I never used Zend\Form. It was a pain in the ass. A HTML mess in PHP trying to decorate my output. Not sure what zf guys have now, but I can't leave without sf's form any more.

- CLI tools. I know ZF2 has its own console component now, but look how much stuff is out there on github using Symfony\Component\Console.

Since ZF2 packages are available via composer now, I use both, but sf will remain as the framework I base my stuff on.
gravatar Sarel van der Walt  — September 07, 2012 12:50   #14
I get the feeling that sf2 gives you the framework around the code more than zf2 does. Both are on it's way to kind of become libraries of tools that could work together, but sf2 has more structure still. My personal opinion is not to be a purist here. One can so easily use zf2 inside your sf2 application and vica verca. @thejw23: you're right that these facts can be ported to zf2, but keep in mind that sf2 got there first. If zf2 is what you like, go for it. SF2 is what we like, so we'll stick to it here at Afrihost :)
gravatar thejw23  — September 07, 2012 12:55   #15
Fabien, it's not about witch framework I like. It's about arguments Why Symfony - bad arguments in my opinion, since most, if not all, of them are not so important for me as a developer.

Bundles, yes, for ZF2 they (modules) are about to be created, but so it was for SF2 when it was developer or just released (but I guess right after the release there were already some very nice bundles for SF2).

But it's a matter of time, within a year this might not be true and what, there will be no real arguments for a developer wondering ZF2 or SF2?

And I really would like to read what you think about that, Why Symfony and not ZF2. With ZF1 it was really easy to say, not it's not so obvious.

Or, maybe putting this in other words: What do you (Fabien) think of ZF2: could they done more, go in some other direction? I guess that actually this is the kind of question that will give me an answer to Why Symfony.
gravatar thejw23  — September 07, 2012 12:58   #16
anonymous — September 07, 2012 12:48 #13
good post, and this is what I like to read in blog post about Why Symfony. Thanks anonymous :)

gravatar Dmitri Lakachauskis  — September 07, 2012 12:59   #17
Not sure why I was posted as anonymous -) Glad to help
gravatar Fabien Potencier  — September 07, 2012 13:00   #18
Jose has just written a nice article about his answer for CakePHP: http://josediazgonzalez.com/2012/09/07/why-to-actually-choose-cakephp/
gravatar Roman Marintsenko  — September 07, 2012 13:10   #19
thejw23 & Alexander Makarov, if all points are same for ZF2, could you list 3-rd party libraries that ZF2 developers used, instead of reinventing the wheel?
gravatar Luis Cordova  — September 07, 2012 13:14   #20
Since I have adopted symfony2 one of the things i most appreciate that did not with Zend2 is the community and the FOSS oriented mind. In the beginning there was this thing called CLA that was rotten bad attitude. So all the world in his right mind turned to Symfony2 the rescuer, there we find great devs like Stof, Johannes, Fabpot, KrisswallSmith, lsmith, even ocramius which is from zf2 would PR symfony2. Everybody realized that Symfony2 was doing things right and Zend2 did not at least on the beginning. I don't want to discourage Zend2 guys, I will actually seek to learn the framework just to complete skills but the reality is that is a big remaking of a wheel. Those efforts and communities would have been put in actually brainstorm more with the Symfony2 community and we could have had even a better Symfony2 or at least we could have had a non-divided larger community. But you chose not to for some reason and that is fine. So all in all in Symfony2 you find room for the newbie and the expert alike, great community. We are now weeks away and we are going to SymfonyLive in San Francisco and we are taking back to South America all that we will learn there. You bet your best there will be consequences of adopting symfony2 as your framework, main EVERYBODY WILL KNOW HOW TO HELP YOU. Choose now. Thanks.
gravatar ???? ???????????  — September 07, 2012 13:23   #21
Fabien: "There are many other good frameworks around that you can choose from too. " - Which?
gravatar Osman Üngür  — September 07, 2012 13:36   #22
I used SF 1 for 4 years and now i'm switched to SF2. I loved Symfony2 because :

Have great peoples and community.

Domain driven design

SF2 switched to Git/Github before ZF2 and this speeds up development of SF2. Also this shows contributing Symfony2 is more easier than ZF to me. (Especially for SVN days of ZF1)

Still SF2 components still more loosely coupled than ZF2.

SF2 brings to annotations and Composer to PHP framework world. This is a huge bonus point.

KnpBundles, Twig, great bundles, libraries..
gravatar Ele Nunna  — September 07, 2012 13:41   #23
This article is completely disingenuous. He asks "Why would you want to use Symfony instead of Z[end]?" and then claims he would answer it in his post. He then goes on to list several good things about Symfony, but then fails to mention that all of these are also true for Zend. Has he even tried Zend before?

Don't go trashing frameworks when you are completely ignorant of them.
gravatar Alexander Makarov  — September 07, 2012 13:55   #24
Roman, for end-user it doesn't matter if framework reinvented the wheel or not. The only concerns are flexibility, stability and support. If ZF2 team did it themselves and did it good, why it's a bad thing?
gravatar Ele Nunna  — September 07, 2012 14:02   #25
Good point Alexander. Also, Roman, you are completely off base. See the following:

http://modules.zendframework.com/
gravatar Jordi Boggiano  — September 07, 2012 14:11   #26
@Alexander / #24: The problem with this approach is not that you just have to redo it and do it right, but then you have to maintain it too. It's a massive time sink which means that you don't get to spend as much time as you could working on the rest - the parts that truly make your stuff unique and great.

This is exactly the idea of open source in the enterprise IMO. Share the bits that are not business critical, re-use some others if you can, and build your secret awesome sauce on top of it for your core product.

The other advantage of "componentization" is that if some new third party lib comes about that kicks ass, you can easily replace the one you used and move on. On the other hand if a new third party lib comes to compete with some component you have in the framework, most likely you won't ditch that component (as a framework author). Of course the framework users are still free to replace the component with NewShinyLib, but if it is not done at the core, it means less people will benefit from it.
gravatar fuckthisshit  — September 07, 2012 14:13   #27
Why not symfony? Because it's fucking PHP, nuff said.

Go with Rails, Django, hell, even build your own in Go
gravatar Wim Vandersmissen  — September 07, 2012 14:13   #28
It eludes me why people are trying to start a flamewar over this. Fabien just mentions the points that - for him personally - are the major selling points of Symfony. He doesn't claim they are not available in other frameworks, and yet some zealots start dropping in screaming their heads off. Maybe you should (actually) read his post (again), and come to your senses.
gravatar Thomas Ploch  — September 07, 2012 14:31   #29
[irony]
You can't expect a Mercedes-Benz advert to include information on BMW products, can you?
[/irony]
gravatar Alexander Makarov  — September 07, 2012 14:36   #30
Jordi, I'm well-aware of what it means to framework developer but for end user it does not matter. If everything is OK noone (except the one who maintains it) cares about how much time spent on it. So it's framework team problem, not end user problem.

Replacing framework component is hardly possible not because framework developer doesn't want it but because extensions and projects are already actively using it. Offering to choose a component yourself isn't a good thing too. There will be lots of third party code written using different components doing the same thing.

gravatar Ele Nunna  — September 07, 2012 14:38   #31
@Wim, how can you ask people to "actually" read the post when it appears you didn't? What part of

"Why would you want to use Symfony instead of Z? That's the question I'm going to answer in this post."

did you not understand? Sounds like he's comparing against Zend to me.
gravatar Tito Miguel Costa  — September 07, 2012 14:39   #32
I had previous experience with symfony 1.* and it took me quite a while to embrace Symfony2, it add a few new concepts and at first they are not easy to grasp. By now, I can see cleary the benefits of Symfony2, it forces me to improve the quality of my code and makes it reusable. Fine enough this could be said about other frameworks, this is not my point. Symfony2 brings improvements that makes it a better framework than the previous versions. But the reputations of not being an easy framework to learn and master haven't changed, judging by the experience of my colleagues. Doesn't help having drop the generate admin, sure there are Sonata and other alternatives, but not official and not working out of the box. Other point is documentation, sure we have a book, many how tos, but many of us learned symfony 1 with jobeet and I think it is a must have for Symfony2, a pratical example built from ground up, this will help to adopt a similar paradigm of developing project with Symfony2 among the community. The Fabien series of building a framework using the Symfony Component were amazing, it helps to understand how they work together and we cleary get their use in the Symfony Framework, more of those are welcome. Keep up the amazing work, developers and community, it helps to improve the PHP skills of all of us, and make a better web.
gravatar Laurent Heurtault  — September 07, 2012 14:49   #33
@Ele: I don't think the "Z" in this sentence is meant for Zend. I think Fabien used Z as a placeholder for a generic framework, just like he used X and Y in a previous sentence.
gravatar Alexander Makarov  — September 07, 2012 15:11   #34
"V" for vendetta, "Z" for Zend :)
gravatar Ele Nunna  — September 07, 2012 15:11   #35
@Laurent: I suppose it could be interpreted that way. But I am not the only one who thought this meant Zend, as Z is common shorthand for Zend. Also, after Zend being the only other framework he mentioned, he proceeds to describe why he things Symfony is the best. If indeed Fabien's intention wasn't to compare against Zend he could have done a lot better at clarifying what he meant.
gravatar Fabien Potencier  — September 07, 2012 15:37   #36
My blog post is NOT a comparison between Symfony and ZF. I thought it was clear enough, but I've just edited the content of the article by replacing Z with X and I've also added some framework examples, so that hopefully, there can't be any ambiguities.
gravatar Marco Pivetta  — September 07, 2012 16:19   #37
Nice feature list, but I'd also add that people should stop doing assumptions such as excluding frameworks mutually. This is mainly for all the people in this thread that (as usual) have this concept in mind.


Since composer entered into the PHP scene, thinking that "I won't use framework X because I use framework Y" is not something applicable.

You just require `symfony/console` and `zend/event-manager` and `propel/propel` and `doctrine/mongodb-odm` all together... See? It works!

So let's think about building things WITH symfony, not "only with" symfony.


Fabien, you should also stop using the word "instead", that just limits the scope of action of the end user ;)
gravatar Marco Pivetta  — September 07, 2012 16:23   #38
Please note that I also wrote `propel/propel` and `doctrine/mongodb-odm` because that front is also "hot". But they are not mutually exclusive libraries.
gravatar anonymous  — September 07, 2012 16:39   #39
please find here an interview in french of some CTO in big entertainment and news company. They all use SF2.

http://www.youtube.com/watch?v=4ex9UIfQ2Aw&feature=plcp

most of them choose Symfony2 because ZF2 wasnt here at the time.

gravatar Jaime Suez  — September 07, 2012 16:57   #40
@Tito Miguel Costa: I agree with you, Symfony2 is great in comparison with Symfony1, but the Jobeet documentation for newbies and the admin generator out of the box and well maintained are lacking points.

All my friends learned Symfony through Jobeet, it was really great documentation. For newbies, but also with very deep insights.

And also al my friends use a lot the admin generator. The new one from Sonata has exceptional features, but it's not ready out of the box and also is not as well maintained as the framework itself.

As my opinion, Symfony Components are great for many purposes, but the full-stack framework isn't as complete as it was on Symfony1.
gravatar Jan Heller  — September 07, 2012 17:43   #41
Well the great thing about the Symfony community is that it is very open to new ideas and input and always willing to contribute. So why not create a Jobeet like tutorial with the help of the community?
gravatar Lukas Kahwe Smith  — September 07, 2012 18:03   #42
@Fabien: I am surprised you didn't mention the Symfony2 certification ;)
gravatar benjamin gonzales  — September 07, 2012 18:25   #43
In the war of frameworks and languages of programming, the only thing that I want is that it wins is my client :)
gravatar sun  — September 07, 2012 18:52   #44
@fabpot,
This is an awesome idea. To drive it further, why not try to introduce an informal standard?

http://[project-site]/pitch

e.g.,
http://symfony.com/pitch
http://framework.zend.com/pitch
http://cakephp.org/pitch
...

And alas, we could do the same...
http://drupal.org/pitch
http://ez.no/pitch
http://www.joomla.org/pitch
...
:)

Lastly, I somewhat agree with a few others here that some of the maturity/marketing/community arguments are not really unique. But then again, you can easily ignore them in your evaluation. (and also, sorta along the lines of: if they need to list that to get the page filled... others might have listed more important things ;))

Anyway, I think this is a fantastic idea. And nothing prevents us + everyone else from just doing and trying it. :)
gravatar Tito Miguel Costa  — September 07, 2012 19:00   #45
@Jan Heller There is already a Jobeet Tutorial for Symfony2, check it out http://www.ens.ro/tag/symfony2-jobeet/ Not sure if the community can participate and in which terms, but it is a good starting point. A few days ago I checked a spanish project in the same terms, can not locate the link at the moment. In my opinion, it is important to have an official manual in the same terms, so the masses can adopt Symfony2 and in the best way, taking advantage of all the core funcionalities it provides.
gravatar Hassan Baazzi  — September 07, 2012 19:01   #46
@fabpot: this post has lost its taste when you modify it :), I forget to make a backup for the older post.

so, what's make Symfony2 great for me is:
+ Form component: it's a very important indice
+ Coding style like in others languages
+ PHP5.3

what make Symfony2 also great is the innovation he has done in this language, and also the inspirations of other languages ??like Python and Ruby

i think the challenge is the chalenge started by fabpot in this post: http://fabien.potencier.org/article/64/php-is-much-better-than-you-think

gravatar Victor Passapera  — September 07, 2012 21:22   #47
The fact that there is a bundle for pretty much anything you'll ever need in your application is what really does it for me.

The documentation is fantastic as well. I read the docs in a weekend and completely understood the framework after.

I used to use Zend FW a long time ago and it was great, but I have to say SF2 is my favorite framework to develop on. It forces me to develop clean testable code. And the community is there to help.

@fapbot: Thanks for building this stack! (And thanks to all the contributors as well)
gravatar Evan  — September 07, 2012 22:09   #48
I've posted a response to this post on my blog:

http://blog.evan.pro/why-zend-framework
gravatar ???? ???????????  — September 08, 2012 11:00   #49
@Evan And that's how you get traffic :)
gravatar Matteo Giachino  — September 08, 2012 11:12   #50
My points:

* the form component in 2.1 is awesome
* integration with phpunit
* twig changed my life
* some great bundles like JMSI18nRouting, FOSUser, LiipImagine, LiipFunctionalTest
* I love the decoupled approach
* dic

And composer, which is not directly related to sf but is already there to be used. And it'a a game changer.
gravatar Anon Y. Mous  — September 08, 2012 12:00   #51
I'm a bit confused: what's the point of this post in the end? Was it to show "why would you want to use Symfony instead of X"? Or just list of "selling points for Symfony"?
Because those two apparently aren't really the same thing as the same "selling points" could be easily used by some other framework or two. And that doesn't mean they're untrue or invalid - Symfony2 has those things and has them done good, so sure thing, go ahead, spread the word around about them.
But that doesn't answer the question: "why would I want to use Symfony over X?", as X has the same things done too.
For that, I would really want to read about some stuff unique to S2, be it either some specific features or some of the architectural solutions - I believe those are the things that really differentiate Symfony2 from the others.
gravatar anonymous  — September 08, 2012 14:34   #52
Coming from ZF1 , i just got into Silex/Symfony. What i like is the modularity of the project. I can easily integrate ZF2 components into my Silex application , by creating a service provider. I can take advantage of the Event classes to trigger things ect... Symfony feels like it is pro and it cares about all the things needed in a development environment : testing , continuous integration , package management. And Symfony embraces good third party php libs and promote them , instead of trying to re-invent the wheel.
There is a real opportunity for sinatra like libs like Silex for php beginners . It embrace a REST-like interface and development good practices yet it is easy to use. I got up and running with Silex in a matter of hours ( i made a quick simple sample app on github : http://bit.ly/SsAjXK ) . and Silex is a bridge to Symfony apps.
So why Symfony instead of X or Y : modularity , huge community , IDE support like Netbeans , DRYness with the bundle system , third party lib integration like Doctrine ... , templates with Twig , great docs , and backed by an awesome company.
gravatar anonymous  — September 08, 2012 22:29   #53
hi All,
I am very much agree with all of You that out there are very good frameworks and also that both SF2 and ZF2 are good frameworks too

Personally, I love Symfony2 because its simplicity and the great power it have

Many thanks to Fabien Potencier and also to the great Symfony Community
gravatar Elias Anzula  — September 08, 2012 23:04   #54
There is one thing that is still missing in 2.x that has been the very strong point of success for 1.0 and 1.4,
stability of code.


These 2.0 and 2.1 releases of Symfony reminds me so much of 1.1 and 1.2, where a lot of developers were excited with new features ( interestingly similar was that they both involved the form framework ), but projects on those minor releases were simply a nightmare to maintain. For developers that have been known for reliability, it's not very acceptable for clients to know that their projects are not built for long term support. Last year, I noticed a sudden surge of client demand for 2.0 development but it has since steadily declined.


In addition to a @Jaime Suez , 2.x still does not have an Askeet/Jobeet reference project that makes
the transition easier for new adapters. Those reference projects just made it extremely easy for any
developer to take someone else's past work and go over the code. It was able to set a very strong standard
on the framework implementation.


gravatar Pierre du Plessis  — September 08, 2012 23:36   #55
I've been using Symfony2 for a couple of months and I really like it a lot. What I don't understand about this post is the following:
"So, besides the buzzwords, what is unique to Symfony? Why would you want to use Symfony instead of X (replace X with ZF, CakePHP, Lithium, Laravel, Slim, Yii, you name it)? That's the question I'm going to answer in this post."

As a developer, none of the mentioned "unique features" to Symfony2 mentioned in this post sells me on using the framework.
This post is more of what Symfony has accomplished, instead of what is unique about it/what makes it better than the rest.

I respect Fabien and what he's done with the framework, but honestly, there is nothing in this post that convinces me to use Symfony over Framework x (ZF, CakePHP, Lithium, Laravel, Slim, Yii etc).

In a post like this, I expect something a bit more technical as to why I should consider using Symfony over any other framework, instead of having only achievements that Symfony accomplished.

I have my personal opinions as to why I would rather use Symfony over any other framework, but I believe every user have personal taste, and would prefer some features of framework x over framework y.

So what I'm trying to say is that this post is nowhere near convincing any user to use Symfony over any other framework, but rather a list of accomplishments that Symfony has achieved.

Every developer have the opportunity to explore various frameworks, and will eventually choose the framework they are most comfortable with, but despite the lack of
convincing this post offer, I would still choose Symfony over any other framework, and that has everything to do with personal experience and absolutely nothing to do with Symfony's achievements over the years.
gravatar Sydney_o9  — September 09, 2012 02:54   #56
I think the best option is to ask users what they think. Not users about other framework, this does not matter. So why Symfony? In my opinion, I started learning Symfony 10 months ago, because I read some reviews of people who created a website with Symfony and managed to get things done. The user is not looking for the best one (even if Symfony is in MY opinion, it will still remain my personal opinion) he wants to use a framework that suits his needs. And Fabien does this beautifully without comparing Symfony with other framework. To make things simple, only experiences count. The framework chooser needs to know what people did with Symfony, in how much time, what's the learning curve, which community, where to find the info, etc...
I would suggest to pick up 5 experiences from 5 users of different levels. One beginner with no experience with Symfony that managed to create a big project, one more advanced user that switched to symfony because it suit his needs, 2 others..., and someone who is VERY experienced, runs a VERY big website, and gets the business done. Symfony is perfection, and people need to know, through experiences. Experiences are the only thing that matter to a framework chooser. So Fabien, within this large community, it wouldn't be hard to find 5 success stories from people that have different knowledge in the framework. They could simply explain why they chose Symfony? Why they are still using it? What they managed to do with it? And in how much time? Long life to symfony.
gravatar Lukas Kahwe Smith  — September 09, 2012 15:23   #57
@Pierre: very much agreed. the above are good points when explaining "why Symfony2" to a manager .. a more technical argument would be appreciated and some have provided some of the aspects in favor of Symfony2 in this thread .. but a more detailed analysis of the tech aspects would be good.

maybe it could be possible to have a few key frameworks collaborate on such a comparison. maybe each framework writes up something, then everyone compares the write ups to ensure the format is somewhat similar and key differences are highlighted and universally available features dont cloud the message
gravatar Hugo Hamon  — September 09, 2012 20:27   #58
One more pro: Symfony embraces the HTTP specification and ease caching. ESI support is natively supported by the framework.
gravatar Pawel Martuszewski  — September 09, 2012 22:12   #59
- Approachable Leader - do you guys know creators of other php frameworks being so active or can we even name them?

This brings additional 'trust'... ;)
gravatar anonymous  — September 10, 2012 01:49   #60
Every so often there is a fundamental change in the way people approach development in a particular language. For example, uptake of Ruby increased dramatically when Rails was introduced.

PSR-0 and namespaces are profoundly important developments to the professional php developer community. Along the same lines, in a few short years, git has completely surpassed svn for team development. Large open source projects are facilitated by software configuration management tools. These tools power the sites that act as hubs. Remember when sourceforge was the center of the opensource universe? Now there is this place called github. People coalesce around the tools and communities that represent the best practices of software development.

As a long time observer of trends in the php community, and someone who worked on large projects written in ZF1 and SF1, I commend both communities for having the self awareness and guts to completely throw away frameworks that were used by a lot of people to do a lot of work. In their own way, both communities have looked to the future rather than the past, and been willing to admit that if php is going to continue to be viable, we needed better quality frameworks, and better ideas.

Symfony2 was the first framework to embrace these changes and build upon them, and get something in a releasable documented form into the hands of developers.

Fabien as the thought leader of the Symfony project, has been faster, more vocal and seemingly quicker to recognize the types of features sophisticated php developers need. This just isn't the case with Zend framework.

I think one reason for this is that here is an advantage to having a company that uses the Symfony tools in its consulting practice. Sensio eats their own dogfood, and has attracted other companies like KnpLabs to do the same.

It's not that there isn't some great stuff in ZF, or that much of it is not well written. There are great developers working on both projects. ZF is a lot larger and more ambitious, or at least it has been in the past. But it has often been overburdened by an academic interest in extreme generalization and decoupling to the detriment of people just trying to get started, who simply wanted someone to tell them or show them how to solve common problems so that they can solve their own.

It's also worth noting that implementing a Dependency Injection framework with a DI Container as Symfony2 did, and being the first to get there IS something worth noting. Implementing a PSR-0 class loader that other projects could use, and getting that out there WAS important, not just to Symfony2, but to the entire php library development community.

Fabien is a diplomat, but I don't have to be. Symfony2 is the best PHP framework in PHP's history. It is a much needed step forward. A lot of people were looking for a project like this to justify their investment in php and facilitate the projects they want to build with the stack.

I'd warrant that a lot of people who discover Symfony2 annotations, fall in love with what they do for you in terms of development, will have a pretty hard time going back to the days of disconnected configuration files. What is available in Doctrine2 and Symfony2 in terms of annotation support is unprecedented for PHP.

Everyone else is a day late to the game at this point, and given the uptake and number of symfony bundles out there, I believe Symfony2's momentum will only continue to increase in velocity. There is a reason that a project like Drupal decides to rebuild themselves on top of the Symfony core. There is a reason why the guy who gave us the GD Library (just admit that you've used it at one time or another) became a Symfony1 (and now 2) user and ecosystem contributor. Everyone who was doing PHP at the time ZF was started, wanted it to become the type of framework that Rails was to Ruby. At last, PHP has a standard bearer -- it just happens to be lead by a french guy, and is called Symfony2.



gravatar Fabien Potencier  — September 10, 2012 08:48   #61
Just to clarify a bit more the goal of this post: Lukas noted that it is targeted more at managers than developers and he is probably right. But I think that choosing a framework is not just a technical decision; it's more than that. Choosing a framework means investing in the long term, and the ecosystem of the framework is as important as the technical side of things. And let be honest, if I had written a blog post about why I think Symfony is better from a technical stand point, the flame war between Symfony and other frameworks would have started right away, and I wanted to avoid that at all costs; I didn't want to compare Symfony with something else, I wanted to give a high overview of the good reasons to choose Symfony (based on facts and by trying to be as objective as you can be).
gravatar weber chris  — September 10, 2012 12:56   #62
I don't understand why people still have to advocate for one or the other framework.

As you said, Symfony is not a framework but a project, the same thing is true for zend framework, you don't need to use one or anothers MVC implementation, you can use a lot of parts/modules without having to use the library/project as a whole.

All other arguments in favor of symfony are also true for the zend framework, uses php5.3, big community and so on ... So why bother choosing one or another.

The great thing about todays frameworks is that they are PSR compliant, that means you dont need to choose one or another, you can use parts of all of them into your projects. Just create a basic composer.json file. You can choose to use doctrine2 and symfony's doctrine brige, symfony filesystem and for example zend frameworks authentification and validator classes or even add a bunch off unofficial components you found on github.

Composer will download the latest version of your favorite components and create and autoloader for you so that you are ready to go within minutes.
gravatar Lukas Kahwe Smith  — September 10, 2012 21:45   #63
@Fabien: I guess we can define a new law here in that "When talking about Symfony2 or Zend Framework its impossible to avoid a flame war". The corollary to this for me is "It makes no sense to try and avoid a flame war when talking about Symfony2 or Zend Framework" .. so everybody please just speak truth and don't hold back when doing so.
gravatar Jinju Nankandiyil  — September 11, 2012 07:25   #64
I wonder why the people put fire into these kind of discussions. The facts/requirements/coding style/practise/concept/meaning or way of ease of handling vary with developer to developer.

In my view when I go for picking a framework I would consider the following stuff.

1. Will see if how often would I need a extension to be updated.
2. What is the expected level of growth/rate of increase in traffic to the app, which will decided which f/w should be picked up. Have to pick up a f/w which is able to handle the existing load and expected load and beyond possibly nicely.
3. Ease of use change with person to person, which is tightly bound to your coding practices and type of work experience you have, and the very requirement for which you are looking for a smart pick.
4. The fact of having scope of support and maintainance of the f/w comes into focus if you expect considerable growth of your app and which will be there actively updated ever and you put in effort which you never want to migrate to another one if you find the f/w you are using is getting outdated and no chance of getting it updated to time.
5. There is no point in thinking like who did one stuff first but have to consider who the candidates did the stuff. The later will always enjoy the possibility of looking into what flaws or drawbacks are there with the first one. But the challenge to the earlier one will be to make compatible to all the other stuff, design patten, architecture and process model followed till date, as the f/w shouldn't put its user in dark for making it into a better styled one.
6. I would always consider the chance of getting the f/w outdated with the newer versions of coding language being used, will go for picking the one which is less tied to the underlying language so that it may introduce some adhoc work to be done to get the app working again with the updated version of language on the server (say PHP)

many more things will diff developers consider, and same developer may think and choose different f/w different requirement, its the matter of choise which matches the current need and the scope of future expansions.
gravatar Skander MABROUK  — September 11, 2012 17:52   #65
Great work Fabien.
gravatar mark prades  — September 14, 2012 00:16   #66
Some forget that the main PHP frameworks are in a process of standardisation. It means they'll all adopt the same way to name their classes in order to be loaded by a standard loader. Therefore you can totally use a part of framework X with a class of Y , There should be no problem using them along side.
Now , of course you still need a kernel , a basic way to route , handle requests and load scripts accordingly , and you can make your own. What matters is PHP big players are now talking together to push the community forward , after all we are all coding in the same langage , ie PHP.
PHP need to be where Ruby/Rails or .Net is , a few main frameworks and , around it a ton of good libraries , but also better tools to integrate professional workflow and Agile methods. But PHP must also take advantage of what it is , a very simple hypertext processor that you can easily deploy on a server , write shell script . With the help of big framework like Symfony or Zend , and micro frameworks like Silex we can acheive that goal and make PHP developpers enjoy the coding even more.
gravatar Marco  — September 14, 2012 00:27   #67
My two cents

I'm a Rails and Grails developer, I like Symfony because it's good, solid, and because it "force" (note the "") developers to use a default stack of technologies; for example, Doctrine integration is very important for my company, and that's because we'll never user Zend. Coming from Rails Active Record and Grails GORM I hope writing Zend_Db stuffs nowadays is simply ridicolous. Obviously I know is possible to integrate in ZF any ORM/DBAL is nedeed, but doin so we are missing the point. If I start a Zend-project with a new developer I'm sure he knows Zend_Db stuffs, I'm sure he don't know Doctrine and how to integrate it in ZF; instead if I start a Symfony-project I'm sure a new recruited developer has knowledge of Doctrine(or Propel). The words are default stack, standard, and best practices, learn from Rails (and Grails), other ways are ridicolous nowadays
gravatar Christian Kaspar  — September 18, 2012 21:34   #68
Besides wetter.com there is another even more relevant large website in Germany using Symfony2 and Varnish: http://www.stern.de/
gravatar anonymous  — October 22, 2012 21:27   #69
I loved reading this article