27

I am starting a new Symfony project that will be very important to my company. My experience is only with Symfony 1.4. and I have 3 months to complete the project.

The project should be around for years and will grow to have many features. I know that many people are already using Symfony 2 in production, but do you think it's a bad idea to go with 1.4?

Every situation is different. I don't see any problem with 1.4, but some people are suggesting I use Symfony 2 because eventually we will need to upgrade and do a lot of rewriting of code.

Plus, there is Doctrine 2. I would be using 1.2.4. Again, I know that Doctrine 2 is really great, but am I going off a cliff by sticking with 1.2.4? It seems to do everything we need.

Thanks for any insight.

sqlman
  • 611
  • 1
  • 7
  • 8
  • 2
    Well, to be fair, Symfony 2 is due to be officially released *tomorrow*, so it wouldn't be too surprising if the answer to the question "Should I use Symfony 2?" has changed over the course of the last few months... – Matt Gibson Jul 27 '11 at 11:59

8 Answers8

39

Why you should use Symfony 2.0:

  • Faster. Many Symfony components have seen performance improvements and it also now supports edge side includes.
  • Fixes weaker design. Symfony 1.x is great, but some components had flaws, like logging (now outsourced) and tasks (more flexible). Forms in 1.x were powerful, but had some flaws; forms in 2.0 are better.
  • It's the future. Symfony 1.x will expire before the lifetime of your project. You already said you will be rewriting it. It makes no sense to wait.
  • Cleaner, easier code. Namespaces, more decoupling, generally even more beautiful than Symfony 1.x was.
  • Doctrine 2.0. Way faster, way easier to use.

The only possible reason to go with 1.x is time concerns. However, if this project is that important, it makes more sense to increase the time limit (if it is unfeasible), then to do it in 1.x and waste all that time rewriting it later.

Jeremy Kauffman
  • 9,973
  • 5
  • 39
  • 52
  • 6
    Whilst I agree with all you have written above, Doctrine 2 is deliberately very lightweight, compared to the previous version. If the OP is expecting behaviours they'll be disappointed. Needs thorough research to understand what you gain and what you sort of lose (or need to do very differently). – Orbling Jul 26 '11 at 01:13
  • 1
    You missed one point, most likely he will be at the same crossroad with the next project; so climb the learning curve now and get on top and over with :p – Tjorriemorrie Jul 27 '11 at 08:49
19

Well, Symfony 2.0 should really be your bet if you had more time to get the project done. Symfony 2.0 developers are still struggling to learn the right way to use all those nice standards and best practices.

The community using SF 1.4 is already mature and has solved every single problem that all the common (and others not common) scenarios could present.

All those arguments about speed do not apply to 90% (or more?) of projects built on SF. Unless you need a high performance webapp (serving more than 500-1000 requests/minute), you gonna be fine using SF 1.4. If you need to serve more than that you can always using one more server to the scene. An optimized SF 1.4 app can perform pretty good.

I'm trying to say that all the talk about performance is not a problem for most apps. People do not think about it when raising the speed flag.

SF 1.4 is a well structured framework. It really speed things up during development. SF 2.0 is a community under development. People are still developing solutions and plugins for the most common problems.

I'm still using SF 1.4 for all my new projects. Mainly because I got a lot done on it that get my projects done really fast. All my customers don't need a high performance webapp, however I have my own projects that need to be fast and after optimization they really are.

P. R. Ribeiro
  • 2,894
  • 1
  • 16
  • 20
  • 1
    This slide can help with the decision http://www.slideshare.net/thrashr888/symfony-performance . – P. R. Ribeiro Jul 26 '11 at 03:09
  • 3
    Define "fine". Doctrine 2 alone can easily cut hundreds of ms off execution time. Hydration is super slow in Doctrine 1.x. Routing in Symfony 1.x is also very slow. – Jeremy Kauffman Jul 26 '11 at 04:48
  • 4
    Fine means that you write your app and its users do not complain about slowness. That pretty fine to me. Users don't care about benchmarks. Better a slower program that works than a faster one that is buggy. Despite the fact that Doctrine 1.x and SF 1.4 routing are slow, you can optimize you app and get 200ms – P. R. Ribeiro Jul 26 '11 at 05:57
  • 1
    @jeremy i agree doctrine2 is faster but some of the functionality is too much complex. like to use mysql functions i will have to first create class for it to parse that function for that you have to first learn \Doctrine\ORM\Query\Parser. is it not time consuming that for every single function we will have to first tell doctrine its behaviour. what if we are using nested mysql functions ? who knows how to parse that ? its really difficult. i am already struggling here with one issue http://stackoverflow.com/questions/24799971/custom-dql-functions-in-doctrine2-partial – hardik Jul 17 '14 at 11:47
5

I've struggled with this since 1.0. Ok great i finished my 1dot 0 project wicked fire it up...no wait there is now 1.1...ok upgrade go through all the upgrade troubles... ok cool NOW it's ready to go but no wait 1.2 is out now...FFS... ok upgraded everything to 1.2 struggled through learning this new forms class and plugin issues cuz sfGuard needs a new version blah blah blah... ok now we are ready to go fire it up but no wait...they've release 1.3 AND 1.4 on the same day WTH. Ok how bad is this upgrade going to be??? phpmailer good swiftmailer bad. or is it the other way around this time. Oh FFS what is this symfony2 all about now.....

I'm sure i'm not the only one that has gone through that (or similar scenario)

what matters is what YOU know and what YOU are good at. Symfony 2 i'm sure is great awesome best ever blah blah blah. But if it takes you three months to get up to speed and work all the bugs out that WILL come up. Then you're better to go with 1.4 and build on what you know.

I'm sticking with 1.4 because i have a large code base that i've built up that works just fine. As you can see by the varied opinions though the debate could rage on for a while.

That's my two cents anyway.

smugford
  • 83
  • 2
  • 7
2

I'm still doing my projects in Symfony 1.4, but outlining a strategy for yourself on how to make those changes towards 2.0 would be a good idea. Also, it sounds like there is some frustration with Doctrine, and Propel development seems to have been awakened. There may be a switch in many preferences towards Propel in the future.

richrosa
  • 805
  • 6
  • 5
2

Short term: If you know that sf1.4 allows you to finish the project in the time you have doing all the stuff requested by the customer go with that.

  • Pro: you know it, no costs for you on technology
  • Cons: end of support November 2012, Lime for testing (or plugin for PHPUnit), using an "old" solution

Long term: As you said the project should be around for years so I think that many developers will work on it. Sf2 is much more decoupled and uses PHPUnit for testing. Allows you to use ESI and performs very good with HTTP standards (no application cache).

  • Pro: brand new tool, very active project, a couple of steps above sf1.4, as web will evolve also Sf2 will embrace that changes and support development
  • Cons: you don't know it but you can hire someone to help you (GTD and learning a new framework)
dlondero
  • 2,239
  • 1
  • 22
  • 32
1

Getting things done is more important than using the latest and greatest and although symfony 2 appears to be a better version all round, symfony 1.4 is still a great product, has a greater pool of knowledgeable developers and therefore if you do hit any stumbling blogs, you are much more likely to find a solution in a much shorter time.

For your purposes symfony 1.4 is good enough and will give you a greater appreciation of symfony if and when you decide to move over to symfony 2.

There are enough similarities between the versions to be able to gain useful knowledge through using symfony 1.4 and it means that for now, you get the best of both worlds -- useful experience for later on and getting things done.

Lloyd Moore
  • 2,939
  • 28
  • 29
0

Go with Symfony 2. I'm doing the switch from 1.4 to 2 right now because of the advanced ACL features of Symfony 2.

It will save you a lot of time in the end.

theaxel
  • 19
  • 4
0

I would go with symfony 2. You have all the feature improvements (faster, doctrine 2, etc etc etc), but that is not why I would go for it.

Symfony 2 has had thorough security testing, which is vital for any real project. Add tot hat the fact that long term support won't cover your projects lifetime, and it really is neccessary to build it in 2.

I just started my first project in SF2, after working for a few years in sf 1.x. There are a lot of changes, but it didn't take too long to adapt.

MrGlass
  • 8,310
  • 17
  • 59
  • 87