CakePHP与Ruby on Rails有什么不同? [英] How different is CakePHP from Ruby on Rails?

查看:144
本文介绍了CakePHP与Ruby on Rails有什么不同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我几乎从来没有听到这个词CakePHP没有听到单词Rails不久之后。这两个框架是基于如何坚持MVC模型主要相似,还是有其他显着的相似性/差异?

I almost never hear the word CakePHP without hearing the word Rails shortly afterwards. Are these two frameworks mainly similar based on how they adhere to the MVC model or do they have other significant similarities/differences?

对我来说,Rails的一个主要景点是Ajax的简单。 CakePHP是真的吗?

One of the main attractions of Rails for me is how easy it is to do Ajax. Would that also be true of CakePHP?

推荐答案

CakePHP就像一个廉价,它试图像Rails,没有做任何东西,使Rails伟大。它有点类似,我猜。

CakePHP is like a cheap, bastardized ripoff of Rails. It tries to be like Rails without doing any of the stuff that makes Rails great. It kinda feels similar, I guess.

CakePHP有一个Ajax助手,做类似于Rails中与Ajax相关的助手方法,所以是的,在某种程度上,它也是真的。

CakePHP has an Ajax helper that does something similar to the Ajax-related helper methods in Rails, so yes, in some way, it's also true.

但是CakePHP是一个无用的练习:它的作者写的,所以他们不必学习Ruby,即使学习Ruby和Rails可能比起弄清楚CakePHP这个怪异的混乱,更容易。

But CakePHP is really an exercise in futility: its authors wrote it so they wouldn't have to learn Ruby, even though learning Ruby and Rails together is probably easier than figuring out the monstrous mess that is CakePHP.

(这是来自某人在他的日常工作中做CakePHP的)。

(This, coming from somebody who does CakePHP at his day job.)

由于y'all问,我对CakePHP的最大的抱怨是如何管理面向对象编程的便利:确保它实现了活动记录

Since y'all asked, my biggest complaint about CakePHP is how it manages to totally butcher the conveniences of object-oriented programming: sure, it implements the Active Record pattern just as much as Rails does, but it makes you pass around data structures.

我觉得任何逻辑人都会使用错误和动态加载的属性来实现一个ORM。到对象,这正是ActiveRecord(Rails库)。设置一个名为 $ recursive 的成员变量以确定要加载的关系是完全有缺陷的整个想法。

I feel like any logical person would implement an ORM using faulting and dynamic loading of properties in to objects, which is exactly what ActiveRecord (the Rails library) does. The whole idea of setting a member variable called $recursive to determine which relationships to load is just plain flawed.

基于PHP是非常致命的,太;你不能对全局状态做任何事情,你必须依赖于 mod_rewrite ,你为每个请求支付启动代价。当然,对于您使用的任何环境都有优化,但仍然如此。人们说Ruby很慢,但是我自己的Rails应用程序的运行速度比他们的CakePHP当然更快,最后我检查。我承认没有这方面的数据。

Being based on PHP is pretty fatal, too; you can't do anything with global state, you have to depend on mod_rewrite, you pay the startup penalty on every request. Sure, there's optimizations for any environment you're using, but still. People say Ruby is slow, but my own Rails apps run faster than their CakePHP equivalents, last I checked. I admit to being without data on this.

最糟糕的是,CakePHP中的错误只是为我杀了它。我可以告诉任何关于

Worst of all, the bugs in CakePHP just about kill it for me. I could tell any number of stories about


  • 的故事,我们花了两天时间弄清楚为什么CakePHP拒绝连接到正确的数据库主机

  • 由于使用太多组件的内存上限,我们的页面时间一半空白了

  • 存储在AppController中的代码量,因为每个组件

  • 按摩数据结构以使XML输出正常工作的黑色艺术

  • 跟踪每个页面末尾显示的空白< javascript> 标签

  • the time we spent two days figuring out why CakePHP refused to connect to the right database host
  • the time half of our pages went blank because of the memory ceiling from using too many components
  • the amount of code that lives in our AppController because every component load costs several megabytes of memory
  • the black art of massaging data structures to make XML output work correctly
  • how we traced down the blank <javascript> tag that shows up at the end of every page

这篇关于CakePHP与Ruby on Rails有什么不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆