Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Why Symfony (over framework X)? (potencier.org)
41 points by dave1010uk on Sept 7, 2012 | hide | past | favorite | 33 comments


The title of this article post "Why Symfony (over framework X)" is highly misleading when all of the arguments that are suggested for choosing Symfony apply also to ZF.

It is also missing a substantial disclaimer, in that the article is written by the founder of the Symfony Project (if you weren't aware)... Anyway... I'm not going ot argue on the merits of which framework is better, (I use both and think they are both fantastic, but this post is grossly misleading if you are trying to do a subjective comparison).

- ZF employs a use at will philosophy. You don't have to use any components or the full stack if you don't want to.

- ZF is also used by many large companies. How is this different to Symfony? (clue: It isn't).

- ZF also has a huge community, it also has a huge demand for ZF developers. As does Symfony. Both IRC channels have several hundred users connected always.

- ZF, also embraces the "don't reinvent the wheel" philosophy (where possible). That's why ZF never tried to implement an ORM. What's the point when Doctrine exists. The only reason it wasn't include in sources is because of mutually exclusive licences.

- "Symfony tries to bring innovation to PHP"... This is a little facetious, but ZF also does the same. Symfony and ZF both have a minimum PHP version of 5.3... Both have started to make the lifes of developers as easier as possible with composer/phar. ZF also uses Dependency Injection...

Background: I use both Zend Framework and Symfony on the same project. Why? Because they both use the same use at will philosophy... So to say "Why use Symfony" or "Why use Zend Framework" over another framework... is misleading again, because ultimately, you are never restricted to a single framework anyway, you can still pick out individual components... The only real choice you have is which MVC/Application you want to use.

Just added this submission also: http://news.ycombinator.com/item?id=4488582


Zend Framework has a disastrous cascading dependency issue. If you're only using one tiny piece, you're probably okay, but if you need something higher-level or if you need a few components that work together, chances are you've just added a ton of files to your project, and that any backtrace you look at is going to be entirely useless.

Symfony has required PHP 5.3 for a long time. Even in 1.4 many plugins required 5.3 and very often the trunk would break on 5.2 because a 5.3 feature squeeked in and had to be rolled back.

Symfony is cutting edge, lean, and for people who want to get maximum productivity out of their time and their LoC. Zend Framework is for people who don't know better.


sure .. they also both use PHP .. what is your point? just because some arguments also apply to ZF2 do not make them non applicable for choosing Symfony2.

however he also mentioned a few others, like a huge list of applications migrating to Symfony2. that being said ZF1 at least at more apps based on it than Symfony 1.x. However a list of Drupal, ezPublish, phpBB etc is indeed quite a big shift that Symfony2 managed to pull off.

also Symfony2 has had 2 major websites in production for 2 years now and a stable release for over a year leading to 1600+ Bundles (of course I would assume 80% are of questionable quality). I am not aware of any major website today using ZF2 and the number of available Modules is much smaller.

the fact that Symnfony2 has a lot more contributors than ZF2 can also not be disputed.

the fact that the lead developer of ZF2 says that when creating their new Form API he didnt even look at the API already in Symfony2 also shows that they do in fact have a reinvent the wheel mentality.

that being said .. ZF2 does have some philosophical differences that might make it more viable for some users with specific preferences. f.e. ZF2 ships with autowiring and a view layer out of the box. these features require 3rd party Bundles for Symfony2.

so my point is .. if you really want to position ZF2 as an alternative to Symfony2 then please focus on what makes ZF2 unique. that would in fact be something productive. listing all the things ZF2 can also do is legitimate as well of course, but can hardly be used as criticism to someone talking about the advantages of Symfony2 unless you can illustrate that the bulk of all PHP frameworks out there provide these capabilities and characteristics.


> "I am not aware of any major website today using ZF2"

I was surprised to read this. Since no one has contradicted, I'll presume it's veritable, but surprising nonetheless.


Well I want to make sure that nobody assumes that just because I am not aware of any major website using ZF2, that its necessarily a fact. Quite likely nobody in the ZF2 community heard that both opensky.com and exercise.com launched on Symfony2 2 years ago.


ZF2 had it's first formal release this week, so the odds of any site running a release candidate formally are pretty low.

After any major release of a framework, there will be a shake out period.. so the long term stability of Symfony is a pretty compelling point to me.


well for Symfony2 there were two major sites running on Symfony2 pre alpha versions (2 years ago) .. and several others more in alpha. Obviously these teams had to spend a fair bit if time keeping up with all the BC breaks before the stable release, but it helped a lot in ensuring that Symfony2's stable release was ready for the real world.


We were running pre-alpha back then, too :)

The performance over our previous ZF app (practically 1-to-1) was huge!

Upgrading was a pain each time, but as a result we all become intimately familiar with the internals and even contributed a fair bit to the core.


Maybe he should have said:

- Symfony2 has a way way better debug toolbar and profiler

- a better integrated assets management (through Assetics and Capifony, both external projects but a de-facto standard, also documented in the main docs)

- a better documentation, focused on how to do, instead of how it works. (As a Zend advocate in some big companies in Italy, the most frequent question with ZF was "where to start?")

- A better command line component

- Even if loosely coupled (eg: Silex), Symfony2 identifies a standard set of components. So when I look for a freelance Symfony2 developer, I know for sure that he will master twig, assetics, doctrine, swiftmailer, the DI container ecc.

- Symfony2 is now a year old, with an incredible amount of bundles available.


Almost all of the arguments are applicable to ZF2 too.

-- "Standalone components". Check. -- "Using by big companies like BBC". Check. -- "Community". Just check StackOverflow for zend framework. Check. -- "Here to stay". It's the Zend company. Check. -- "Innovations". Just check the source code of ZF2 and be amazed. Check.


That's why he said that he's not trying to discredit other frameworks, he's pointing out the selling points for Symfony2. I like both ZF and Symfony2, they are both very different frameworks and are fun and easy to work with. It's just a matter of personal choice.

Fabien deserves some credit for being so open, it's open source, people should use what they like. And if they don't know what to choose it's things like this they should be basing their choice on. I'm waiting for matthew to write the counterpart :)


Symfony2 was great and it's still great. It's "the state of the art" for "how a good PHP framework should be".

But announcing a minor version upgrade on the same day with a "Omg, i was waiting for this framework for 3 years!!" framework is not cool. It's some kind of "news hijacking".

By the way, sorry for my bad english.


Unfortunate timing indeed.

To be fair, the final RC's for Symfony2 and ZF2 were announced last week on the 28th and 29th respectively, both with a note stating the final release would be this week. Today was the last chance to release without half the world packing up for the weekend or breaking their promise.


Is ZF2 rewritten from scratch ? I have a fuzzy memory of ZF1 being quite php4ish in its design.


Yes, It's written from scratch but ZF1 wasn't php4ish too. It couldn't even work on PHP4.


Ok, I must be confused then, I didn't want to troll.


So are there any objective reasons to use (modules from) one over the other (apart from already being familiar with one)?


I've used Symfony and ZF2 modules (mostly Zend\Http) together via Composer, but it's really a matter of preference.

As a side note, I just switched to using GuzzlePHP for HTTP requests instead of Zend\Http.


Why did you link to TED, but not YouPorn? :)


I think because of SEO


The documentation and tutorials I read for version 1 was superb, I've not dived into 2 enough to know, is it as good ?


The docs are stronger than a lot of other frameworks I've looked at, the google group has a nice friendly community behind it, and Fabien and Christophe are very involved and open to the community there and on github.

Shameless plug for what is currently vapour. Hopefully in December and January (if projects finish on time) I'll be writing my introduction to Symfony book, a large chunk will be free online and expanded on as a leanpub ebook https://leanpub.com/philrenniesymfony2


In my opinion, version 2's documentation is superb. I can't compare it directly against version 1's (never used / read version 1), but it's well written, well structured, has clear examples (including some which are non-trivial), and dives into various concepts (e.g. the section on HTTP caching). Overall, excellent documentation.

Here's a link to the documentation if anyone's interested: http://symfony.com/doc/current/book/index.html


I'd like to see a Kindle version (Symfony 2.0 Book)


If I were to choose a single reason as a developer, it would be the Form component. Forms are historically a nightmare of boilerplate, validation, normalization and data mapping, but it is nearly trivial to go from $_POST to a populated object graph.


Nice but not enough to make me switch from CakePHP or make me sad I didn't pick Symfony to begin with.


CakePHP and Symfony are two completely different beasts. If you don't see the merits of Symfony yet, chances are you're not working on projects of a scale that benefit from using Symfony.


Mind to elaborate?


BBC PHP framework is Zend Framework, it's sad to see such a lie as one of the main selling points. If Symfony is used at all in BBC is perhaps only to experiment the alternatives.


Most large organizations use a variety of tools (and languages!) throughout. For example, odds are that BBC America uses a different set of tools than BBC proper. I seem to remember they were using Drupal at one point too.

It's not an national thing but simply because each group has its own requirements and - unless there is strict governance over tools - people choose different solutions for different tradeoffs and things drift.


They have at least confirmed they use Silex, which is based on Symfony components.


I don't know who you would mean with "they", but BBC doesn't use Symfony nor Silex. Feel free to contact BBC Future Media engineers, many of them are on linkedin.

That history about Silex is ONE developer testing it on a pet project, which is a completely different thing than saying "BBC uses Symfony"


According to a recent talk by a lead developer, the website does now implement Symfony2 components on top of the Zend Framework.

https://speakerdeck.com/u/jcleveley/p/how-we-built-the-new-r...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: