Published by Fabian on 16 Apr 2008 at 04:51 pm
Response to Andy Jeffries: Why Ruby is better than symfony
Dear Andy,
I read your blog about symfony and that you now switched to Ruby on Rails. You claim to work with symfony, but I cannot understand how you then can come up with those 20 things that Ruby handles better than symfony. Perhaps you made some up to complete your list of 20? Or you just don’t know?
Yes I am biased to symfony, but I am not advocating the one or the other here.
So here my remarks to each of your points:
- If you think that Propel is inferior to AR, thats fine with me. Btw there is a doctrine replacement for symfony available.
- Also matter of taste, I think both do a good job here, and neither is perfect
- You miss to mention that symfony also has an integrated test system and fixtures. I wonder how you could miss the entire chapter about testing in the symfony book.
- Propel has Behaviours, and there are tons of readymade plugins out there for that purpose.
- the built in webserver is unique to RubyOnRails. In my personal opinion thats unneded but helps with prototyping.
- Well thats php not symfony. If ruby is better thats fine.
- Yeah big big minus for symfony. Luckily there are a few guys that started working on this in plugins.
- It sounds like that you think symfony has got no environments? it has.
- PHP hasn’t, but symfony has a database session store, cool eh?
- Symfony hasn’t too much support for webservices built in. sad but true.
- Thats a nice feature. I think thats on the roadmap for sf1.1.
- You can do custom tasks in symfony. 1.1 has even the same syntax.
- Deployment is cool? symfony also has something there. I never used it because I think that deployment is a more controlled process rather than a developer executing a task. What I saw from the symfony one it also was not too powerful.
- I thought RoR has an own server
- Well you can write easy filters in symfony 1.0. Fabien changed the filter system for 1.1. I am not sure if i will like it.
- No interactive debugging in symfony. I think its a PHP issue but actually it is an issue.
- Cron isn’t supported in symfony. But you can designate some scripts as batch scripts.
- Profiling is nice. I have to have a look at it!
- Flash
- Again a whole chapter that you seem to have missed in symfony. I personally find caching a very good part in symfony. It is fast and very easy to use.
Wrapping it up, I can notice that you missed your target of listing what is better in Ruby on Rails than in symfony:
there are some things that make it less than perfect when compared with something like Rails
In 8 out of 20 of your points you were just unaware of the features of symfony. I cannot believe that you claim to develop in symfony but haven’t read the great documentation. The whole book is online and free.
Other aspects of both, symfony and Ruby on Rails, I personally dislike: developer and process tools, such as crons, deployment, servers etc do not belong into a web application framework. It should be inside the development process. Perhaps even bundled with an IDE, bug tracker, or SCM tool. But not in the “language” itself.
But since you are so happy about RoR, I am very excited, because I will try it also myself.
In essence I think that symfony and Ruby on Rails are very similar. The major difference is the language. I think.
NiKo on 16 Apr 2008 at 9:11 pm #
Everything has been said when he wrote: “I decided to pick a new skill to learn this year as an investment in my future”. When you’re in this kind of mind process, you usually forget everything you’ve done before, even if you’ve done it partially. You want something new. That’s it.
I’d have prefered he provided some patches or invest a bit more with the symfony community to make things happen, but it’s actually more comfortable to quickly switch to another language/framework/town/wife/car or whatever. But I suspect he’ll switch a lot in the near future, because what makes a good tool is when you know and use it efficiently, not its hypeness factor.
Anyway, learning something new is always a good idea, and who knows, maybe he’ll switch back to symfony somedays?
zero0x on 17 Apr 2008 at 6:28 am #
Hi,
I am using symfony for 8 months now.
And I have also been thinking about switching to ruby. Why? Because everyone use it. Ok, not everyone, but lot of people.
The only think I’m afraid of is learning of new language and new everything..
symfony is definitely best framework for PHP, but I feel like ruby is something different. So that’s the reason why I’d like to learn it, not because symfony is not enough for me
Andy Jeffries on 17 Apr 2008 at 9:40 am #
Hi Fabian,
First off let me say that I’m so glad that my post got such an interesting response. I’d like to take the opportunity to clarify a few things. Overall let me say that the blog post wasn’t meant to be a “Symfony vs Rails” discussion – just a list of why I think Rails taps every area a Web Developer needs to be professional. I’m well aware that Symfony hits a lot of them.
“Perhaps you made some up to complete your list of 20?” – the fact there were 20 was a coincidence not a planned event, otherwise I would have titled the blog post “20 reasons why…”. I actually didn’t notice it was a round number until your statement.
“If you think that Propel is inferior to AR, thats fine with me. Btw there is a doctrine replacement for symfony available” – I’m well aware of this, but haven’t used Doctrine yet (as it doesn’t come installed by default and I use Propel at my current contract).
“You miss to mention that symfony also has an integrated test system and fixtures. I wonder how you could miss the entire chapter about testing in the symfony book” – LOL!! I don’t mention every area by saying “Symfony also has this”. As I acknowledged a t the top of the article, Symfony takes a lot of inspiration from Ruby on Rails and I’m sure Fabien/Francois would agree there. And for what it’s worth, working in a department of 30+ symfony developers, being Technical Lead for a team of them and working within a Scrum/Agile environment I’m well aware of the built-in testing framework with Symfony.
“Propel has Behaviours, and there are tons of readymade plugins out there for that purpose” – I’m aware (and at my current contract we have written lots of them, myself included), but there is a world of difference from this:
class ForumPost { } $columns_map = array('left' => ForumPostPeer::TREE_LEFT, 'right' => ForumPostPeer::TREE_RIGHT, 'parent' => ForumPostPeer::TREE_PARENT, 'scope' => ForumPostPeer::TOPIC_ID); sfPropelBehavior::add('ForumPost', array('actasnestedset' => array('columns' => $columns_map)));To this:
“It sounds like that you think symfony has got no environments? it has” – Again, having been a symfony developer for a year and currently being a Technical Lead of my team, I’m aware of this. I wasn’t pointing out “Symfony doesn’t have this” just “this is one of the reasons Rails is cool”.
“PHP hasn’t, but symfony has a database session store, cool eh?” – but no pure cookie session support.
“Deployment is cool? symfony also has something there” – yes, but it’s very basic:
symfony sync production go
Which just does an rsync from your copy to the remote server. It doesn’t go through source control, it can’t go to multiple backend servers in one go, it can’t upgrade database structure afterwards. There is so much more that Rails deployment/Capistrano can do.
I could keep going on and on, but I’ll just re-iterate in response to another quote “Wrapping it up, I can notice that you missed your target of listing what is better in Ruby on Rails than in symfony” – my target wasn’t listing what is better in Rails compared to Symfony. Maybe I need to clarify the introduction, but the article’s intention was to explain what makes Rails a great environment, touching all the areas you need as a professional web developer. Symfony has a lot of them, I’m sure Django does to, CakePHP, CodeIgniter, I could go on… But the point was that Rails seems to have them all in one place, ready to go, well thought out (ignoring their issues with Components which personally I like, as much as it bendsMVC).
Cheers,
Andy
Andy Jeffries on 17 Apr 2008 at 9:45 am #
@NiKo:
“I’d have prefered he provided some patches or invest a bit more with the symfony community to make things happen” – generally I would, but I can’t submit most of the stuff we create at work (the company I’m currently contracting at, in Symfony, is a large international and they are funny about releasing source code).
“But I suspect he’ll switch a lot in the near future, because what makes a good tool is when you know and use it efficiently, not its hypeness factor” – I’ve been a PHP developer since 1999 and am a ZCE in PHP4/PHP5. Believe me when I say I am now must comfortable/efficient in PHP. But that doesn’t mean that I should always stick with the same language (otherwise I’d still be a Delphi Developer – “A *WHAT* Developer”). I don’t switch easily, but that doesn’t mean I shouldn’t try if something good comes up.
“Anyway, learning something new is always a good idea, and who knows, maybe he’ll switch back to symfony somedays?
” – Again, I’m a contractor in Symfony at the moment, making a very good living and have no plans to start using Rails in my day job anytime soon. So, I’ll still be a Symfony user for a long while to come yet, but if I can learn something outside that makes me more efficient and brings ideas of how Rails is better to my day “job” as a Symfony developer how can that be a bad thing?
Fabian on 17 Apr 2008 at 10:23 am #
Hi Andy,
glad that you commented. As you hopefully saw, I am totally fine with statements that show how cool ruby is. Thats why I also want to have a look if i have some time.
If you could rephrase your article slightly that it doesn’t look like a comparison, then I am fine.
If you wan tto compare take my notes into account. Thats all.
I can fully understand your motivation to learn something new
Andy Jeffries on 17 Apr 2008 at 1:36 pm #
I’ve posted an update to the article (just a paragraph at the top that explains my motivation and that it’s not a comparison). Maybe sometime I’ll write an article doing a fuller comparison between Symfony and Rails… Or you could after you have a fuller look at Rails;-)
Joel Wickard on 17 Apr 2008 at 5:22 pm #
“’Deployment is cool? symfony also has something there’ – yes, but it’s very basic:
symfony sync production go
Which just does an rsync from your copy to the remote server. It doesn’t go through source control, it can’t go to multiple backend servers in one go, it can’t upgrade database structure afterwards. There is so much more that Rails deployment/Capistrano can do.”
One thing to note is that Capistrano is not Rails specific / only, especially with the release of Capistrano 2. My team currently uses Capistrano to automate the deployment of our Symfony applications.
Eno on 17 Apr 2008 at 10:01 pm #
@Andy
BTW, there *is* a symfony console of sorts.
http://code.google.com/p/symfony-interactive-shell/
So you can run a “console” similar to irb – Ive used it to do stuff like this:
Ive been very interested in Rails since 2004 (I host nycruby.org and help organize the meetings of my local Ruby group), but my day-job is PHP/symfony so I dont get to play with Rails as much as Id like. Also, to get the best out of Rails, you really need to learn Ruby so you’re basically learning two things at the same time – not always easy especially if you dont have a lot of time to devote to them. But Im playing with Capistrano to deploy symfony apps
Im hoping that future symfony releases will take the best ideas from both Rails and Django (a lot of indications seem to show that this is happening). I too was very enthusiastic about Rails and Ive no doubt in my mind that it has brought a lot of good ideas and best practices to web development in general. But my enthusiasm did make my gloss over some of the things I didn’t like. So I guess all Im saying is that’s there’s no perfect framework, Rails and symfony are both good within their ‘languages’ communities.
Marcus Bointon on 18 Apr 2008 at 3:22 pm #
Regarding points 16 and 18, it sounds like you’ve not used xdebug and kCacheGrind with PHP. Flexible interactive local and remote debugging in numerous IDEs, and really amazing interactive graphical profiling. Start at http://xdebug.org/ (or just ‘pecl install xdebug’) and fink/port/apt-get install kcachegrind. It’s entirely possible that Ruby could have/get valgrind-compatible profile output too.
PHP Weekly Reader - April 20th 2008 : phpaddiction on 24 Apr 2008 at 8:22 am #
[...] This seems to be a reoccurring theme lately — PHP and Respect. Its frustrating to read things that are not true written by people without real first hand knowledge and experience with the language. However, the reality is that good code is written by knowledgeable and skilled PHP developers and most impressively actually used on production sites the world over, To me you have earned respect when the code you write gets used by millions of users every day. Beautiful elegant solutions that never make it off of a development server and into the wild just don’t matter. Fortunately I am entertained by mine is better than yours conversations like this Why Ruby is better than Symfony and the response Response to Andy Jeffries why ruby is better than symfony. [...]
Framework Popularity/Favouritism/Biase … on 28 Apr 2008 at 9:59 pm #
[...] reading a couple of posts this week arguing the corner of both Ruby on Rails and Symfony, I found myself thinking about which [...]
Gregory on 13 Jun 2008 at 12:46 pm #
I’ve been using symfony for almost 2 years now for our website (millions of visitors per month). I think I know pretty well the limitations that symfony imposes, at least to us. I’ll make it simple: Symfony is good, is very good as a PHP framework. But not good enough for our new requirements.
We need to develop fastly, reliably, and with a minimum number of dirty hacks. Thanks to Symfony we have achieved great things so far. But now is the moment for us to move forward.
We’ll give a few recent examples of things we can’t simply ignore anymore. Sometime, these limitations are surely due to PHP more than Symfony but hey, Symfony is PHP based – for the good and the worse and therefor inherits some of its problems.
1. Propel has behaviours. Great, sounds good; then you see the amount of code you have to inject into your classes to make it work (see example above). Ok not that great but still usable and it’s a PHP limitation here, it couldn’t be done differently anyway. But wait, it also prevents me to use __call() in this class as well ? Not good at all, not flexible enough…
2. Yaml support. Could Symfony support _all_ the features of the language please ?
3. Template caching: ok but not so great. Symfony has template caching for actions, partials and actions + layout (the page is then fully cached). But actually, caching is just half of the problem. Now the question is how can I expire _one_ item of the cache manually ? Short answer: you can’t. Longer answer: you can, but it hurts _a_lot_.
Looks like GIT vs SVN. You can branch easily but then you may struggle when it’s time to merge your changes back to the trunk.
4. Admin generator. Do you guys really thinks it’s the way to go ? Are you really really sure ? Think harder because it’s waaaay too complex to be interesting. Not when you use them, but when you have to modify them (which may or may not happen depending in your requirements).
5. Migrations please. (I know it’s already been said but it’ll really help everyone).
I could continue all the day like that. We’re switching to Rails in 6 months. It’s all planned and budgeted. Thank you Symfony it’s been a pleasure to work on this framework. PHP go to hell.