dongzhi9192 2013-12-18 06:02
浏览 47
已采纳

我应该选择使用Ruby on Rails over PHP构建哪些类型的网站? [关闭]

I have read many advantages of Ruby on Rails over PHP with a platform. However, it seems like Ruby on Rails is limited compared to PHP with a platform. Is there any special types of websites, such as blog, portfolio, ecommerce, job-search, content management website and etc., where I should choose Ruby on Rails over php with a platform?

For example, I've been meaning to build a ecommerce website with multi-vendors. However, many people recommended using PHP. Also, when I looked through the popular website examples using RoR, majority of website seemed like company websites with limited contents, portfolios, or websites with video links.

  • 写回答

1条回答 默认 最新

  • dongrao1862 2013-12-18 06:40
    关注

    Rails is an MVC framework, PHP is a language. You might look into "Cake" for a proper comparison.

    Rails will do anything you want it to do*. A lot of this comes from the rubygem ecosystem, most of which are usable without rails.

    Out-of-the-box, with no other alterations, Rails provides really convenient places to describe your data (the models), figure out what data should be used to respond to requests (the controllers), and how to show that data as an HTML web page (the views).

    *Except be faster than micro frameworks (sinatra, flask, ~ node)

    I would not use rails to build something the size of Twitter or Facebook. I would definitely use Rails to build the first versions of Twitter and Facebook that hit the web.

    I frequently refer to Rails as "a website in a can". As such, it is excellent for every example on your list, although it'd likely be overkill for a portfolio because you don't need the database.

    Finally, if your problem is in any way a common one? If you are seeking to build a "normal" sort of website? If you think other people have solved the same problems you are trying to solve? Rails (plus gems) will do it for you, and keep you happy* while you do it.

    I have an interview question: Build me a website with users who have avatar pictures. One guy literally did it one line of bash prompt, via the rails-composer tool.

    Remember - There are basically two principles in RoR. One, from Ruby - "Maximize Developer Happiness", and one, from Rails - "Convention over Configuration". AKA, you will enjoy yourself, and frequently have to do nothing.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误