[英]Should I rewrite my Codeigniter/PHP app in Ruby on Rails? Why?
I already have v1 of my webapp written in Codeigniter/PHP. 我已经在Codeigniter / PHP中编写了我的webapp v1。 I'm now working on v2, which will have some significant changes to all MVC components. 我现在正在研究v2,它将对所有MVC组件进行一些重大更改。
I'm pretty comfortable with CI and I like it. 我很喜欢CI,我喜欢它。 Very intuitive for a C coder like me. 像我这样的C编码器非常直观。 But I am wondering if it is worth it to rewrite the app in Rails? 但我想知道在Rails中重写应用程序是否值得? Will the productivity gains be worth the cost of learning another framework from scratch? 生产力的提高是否值得从头开始学习另一个框架的成本? I want to be practical and not chase something just because it's cooler or more fun. 我想要实用而不是追逐某些东西只是因为它更酷或更有趣。
Here are some productivity criteria: 以下是一些生产力标准:
HTML and CSS generation is fairly labor intensive. HTML和CSS生成相当费力。 Does Rails have anything distinctive to help with this? Rails有什么独特之处可以帮助解决这个问题吗?
I'd like to reuse other people's code for commonly implemented functionality (eg interfacing with FB, Twitter, and other social sites). 我想重用其他人的代码来实现常用的功能(例如与FB,Twitter和其他社交网站的接口)。 How much more 3rd party code reuse would I get with Rails? 使用Rails可以获得多少第三方代码重用?
How much more benefit would I get from the Rails community vs. CI community? 我从Rails社区与CI社区获得了多少好处?
Make automated testing easier. 使自动化测试更容易。 I test manually today, which is labor-intensive. 我今天手动测试,这是劳动密集型的。
I'd appreciate specific benefits vs. idealistic/religious arguments. 我很欣赏具体的好处与理想主义/宗教论点。 Thanks! 谢谢!
Codeigniter is obviously a framework built on PHP. Codeigniter显然是一个基于PHP的框架。 While there are fundamental differences between PHP and Ruby, all of your criteria can be met with either of the two languages. 虽然PHP和Ruby之间存在根本区别,但您可以使用这两种语言中的任何一种来满足所有条件。 Migrating to Ruby would seem to be a waste of time considering your requirements. 考虑到您的要求,迁移到Ruby似乎是浪费时间。 There are plenty of ways to automate HTML/CSS in PHP and there are numerous open source Facebook/Twitter integrations (just check FB and Twitter developer sections). 有很多方法可以在PHP中自动化HTML / CSS,并且有许多开源的Facebook / Twitter集成(只需查看FB和Twitter开发人员部分)。 There are also plenty of open source PHP testing options available. 还有很多开源PHP测试选项可供使用。 Google is your friend! 谷歌是你的朋友! IMO it would be a big waste of time to rewrite your entire application for the sake of your criteria when there are plenty of PHP solutions to your problem. IMO在你的问题有很多PHP解决方案时,为了你的标准而重写整个应用程序将是一个很大的浪费时间。
I think the better comparison here would be CI to Symfony. 我认为这里更好的比较是CI到Symfony。 Symfony 1.4 is a PHP framework pretty much on par with Rails functionality - as far as I can tell through my research, anyway (I'm not a Ruby programmer). Symfony 1.4是一个几乎与Rails功能相当的PHP框架 - 无论如何,我可以通过我的研究告诉我(我不是Ruby程序员)。
If you were to switch to to Symfony, you would gain a lot of productivity tools. 如果您要切换到Symfony,您将获得许多生产力工具。 Symfony 1.4 + Doctrine has the ability to generate a lot of your code/interface for you. Symfony 1.4 + Doctrine能够为您生成大量代码/接口。 Symfony/Doctrine likes to keep you away from repetitive tasks such as building models and data validation. Symfony / Doctrine喜欢让您远离重复性任务,例如构建模型和数据验证。
If you want to do your research ahead of time, I suggest reading through Symfony's free e-book Piratical Symfony to give you an idea of how things work in Symfony. 如果您想提前做研究,我建议您阅读Symfony的免费电子书Piratical Symfony ,了解Symfony的工作原理。
Now, with all that said I feel obliged to mention that the Symfony team is working on Symfony 2.0 which will not be backwards compatible with Symfony 1.4. 现在,尽管如此,我还是有必要提一下Symfony团队正在研究Symfony 2.0,它不会向后兼容Symfony 1.4。 The expected release date is March of 2011. I expect that maintenance on Symfony 1.4 will continue in the future. 预计发布日期是2011年3月。我预计Symfony 1.4的维护将在未来继续。
-- Edit -- - 编辑 -
I also think that sticking with your native language would allow you to develop with the least amount of overhead. 我还认为坚持使用您的母语可以让您以最少的开销进行开发。 Changing to a new language means having to learn it's up's and downs in order to be truly productive. 改用一种新语言意味着必须学习它的起起落落才能真正有效。
IE to be at a point where you're not coming back in 6 months to fix a bug that an experienced Ruby developer would have known to avoid. IE将在6个月内没有回来修复经验丰富的Ruby开发人员应该避免的错误。
To me, this is more a question of how big your current web app is. 对我来说,这更像是一个当前网络应用程序有多大的问题。 If it took you a couple of weekends and you do not have a tight deadline, I would switch to Ruby/Rails. 如果它花了你几个周末并且你没有一个紧迫的截止日期,我会切换到Ruby / Rails。
However, if it's significantly large and you actually want to come up with R2 in a timely fashion, I would suggest sticking with PHP. 但是,如果它非常大并且您实际上想要及时提出R2,我建议坚持使用PHP。
As to your specific questions, I'm not too familiar with PHP, but I don't think Rails will give you a whole lot more in the HTML/CSS department. 至于你的具体问题,我对PHP并不太熟悉,但我认为Rails不会在HTML / CSS部门给你更多。 Not sure about the next two bullet points. 不确定接下来的两个要点。 Ruby does have much better automated testing tools, with new stuff coming out all the time. Ruby确实有更好的自动化测试工具,新的东西一直在出现。
Here are a couple links about Derek Sivers, who switched from PHP to Rails to PHP and now likes Rails again. 这里有一些关于Derek Sivers的链接,他们从PHP切换到Rails再到PHP,现在再次喜欢Rails。 It might help your thinking. 它可能有助于你的思考。
http://www.oreillynet.com/ruby/blog/2007/09/7_reasons_i_switched_back_to_p_1.html http://www.oreillynet.com/ruby/blog/2007/09/7_reasons_i_switched_back_to_p_1.html
http://railstutorial.org/ruby-on-rails-tutorial-book#foreword http://railstutorial.org/ruby-on-rails-tutorial-book#foreword
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.