Ruby on Rails and CakePHP Comparison

diyana wrote:

i have questions regarding to the two frameworks…for your information,
i’d assigned to develop e-portfolio system within 6 month…and i have to
decide either Ruby-on-rails or cakephp…i never use ruby b4 and i don’t
know how ruby works…i try to install ruby…but i can’t install
gem…seems my computer didn’t reconize gem…is it relevant for me to use
ROR or just use cakephp?is it possible to learn ruby in short time?

6 months is an eternity. No need to buy books right away.

First invest some time in Ruby. Here are some Nuby gaps filled in:

Gap 0) Interpreter environment. Install Ruby. Run fxri (Instant Ruby
Enlightenment docs+IRB). Install RDE (F5 eval, syntax highlight,
save files). Start with texts Poignant Guide
http://poignantguide.net/ruby/ and Learning R. (next to the doc
bundle).

Gap 1) …uh this post is taking too long

Classes are mixins. You can add a method to say, File class. See
Kernel method for y method (yaml.rb).
Why Ruby? That’s cumulative effect.
File class is documented in the UPPER MIDDLE scrolling list of the
standard web docs.
You get access to functions by using “require” effectively.

Ah yes, found my list, saved the best Nuby Gap for last:

There are 5 Var_dump()s in Ruby:

p
pp
y
to_yaml
inspect

HTH,
-r

I’m also using CakePHP and deployed some Cake-based projects, although
now I’m using Rails on most of my web projects. CakePHP is largely
based on Ruby on Rails, so I don’t think you’d have any trouble with
the structure of the framework. There’s the models, views,
controllers, helpers, and routing in both (scrap the concept of
components in CakePHP, as it’s a hindrance when using Rails). You
might have a bit of trouble though when it comes to differentiating
between the concepts of the model class in CakePHP and Rails. In
Cake, the model class acts more as a utility class than an actual model
class (your model data is returned as an array of values), while in
Ruby, it’s the model AND utility class (your model data is the
instantiated model class).

As for the language, once you’ve grasped the structure, you’d have
little trouble in coding in Ruby, and if ever you run into trouble,
just google your problem coz’ there’s tons of information, tutorials,
q&a’s and the whole shebang around the Rails worldwide community. Or
get yourself a copy of Programming Ruby and Agile Web D. with
Rails (you can get the book, but there’s tons of CHM and PDF copies
floating around), and of course the Rails API
(http://delynnberry.com/projects/rails-chm-documentation/). These are
the three most important resources for Ruby on Rails, although at some
point you would find that the Rails API is worth more than Agile Web
Development with Rails book.

Six months is too long. If you’re persistent, you could learn the Ruby
language structure in less than a week (I’d say 2-3 days, maybe 1 will
do). And in another week, you’d know how to create your Rails app.
Give it more time, and you could delve into the wonderful world of
Rails unit testing (yes, it’s built-in, unlike in Cake, and the same
goes for the mailer), plugins, rake, Capistrano deployment, Ruby
metaprogramming and more. In less than a month, you have an app ready
for deployment.

Ruby is a great language, and Rails a great framework. So good luck
with the learning process. It ain’t that hard.

THANKS GUYS FOR UR SUGGESTION…AND ROR IS ABSOLUTELY GOOD…
FEEL FREE TO ANSWER MY SURVEY… THANK YOU VERY MUCH FOR YOUR
COOPERATION…
http://FreeOnlineSurveys.com/rendersurvey.asp?sid=my46gk17849bvgm261102

Excellent discussion, and I’m glad to see it continue.

I highly recommend the “Agile” book, which I’ve been devouring over the
past few days. The example they use for discussion is developing an
ecommerce site – and as someone who has PHP-coded from scratch and
manages just such a beast (much more elaborate than the example), I can
see with every page how Rails would make my job a lot easier, a lot
quicker, and a whole lot better to maintain and enhance.

I briefly considered CakePHP, mainly because I was concerned about Rails
deployment issues: How well does it actually run on a production server?
(We rent a Linux box at a hosting farm.) Do I have to scrap Apache to
make it work? (Talk about barriers…)

Happily, the Agile book has an excellent discussion about running Rails
using Apache and mod_proxy, which satisfied my concerns. I may still
look into Cake for PHP-only jobs, but where I have the option I’m going
with Rails.

James,

I don’t think order is important, but you need both books and probably
more! I went through the Agile book first, and that got you up and
running so you felt you too could be successful, but since Ruby was new
to me, I could read the language but writing my own code was only a
subset of what I had experienced in the book. So Ruby for Rails filled
in a lot of gaps, explained things differently which gave added insight
and so on. So now I’m working through Apress’ “Beginning Ruby on Rails
for E-Commerce” by Hellsten and Laine and it’s adding even more to my
knowledge.

The next really good book would probably be a dialog between all these
authors, talking through their similar projects and exploring the
differences in their approaches and uses of the Rails framework and Ruby
constructs!

Jim

On 1/31/07, mike [email protected] wrote:

I highly recommend the “Agile” book, which I’ve been devouring over the
past few days.

I’m only a few days away from finishing 2nd edition myself.

The example they use for discussion is developing an
ecommerce site – and as someone who has PHP-coded from scratch and
manages just such a beast (much more elaborate than the example), I can
see with every page how Rails would make my job a lot easier, a lot
quicker, and a whole lot better to maintain and enhance.

That’s what I tell my PHP/Perl-loving peers. “Just read the book… at
the end you’ll get a good head start on a nice shopping cart.”

I briefly considered CakePHP, mainly because I was concerned about Rails
deployment issues: How well does it actually run on a production server?

Same as most PHP apps I suspect.

(We rent a Linux box at a hosting farm.) Do I have to scrap Apache to
make it work? (Talk about barriers…)

No. You can proxy through Apache to your mongrel or lighttpd instance.

http://destiney.com/blog/lighttpd-proxied-under-apache-mac-os-x

Happily, the Agile book has an excellent discussion about running Rails
using Apache and mod_proxy, which satisfied my concerns. I may still
look into Cake for PHP-only jobs, but where I have the option I’m going
with Rails.

Cake seems nicely written but last time I gave it a little of my time
it felt incomplete… it didn’t have nearly the js integration compared
to that of Rails. Anyone can toss 3 folders at you and tell you to
split up your logic and code MVC style.

For me I hate writing js. I hate debugging js. I hate helping
clients understand why my js doesn’t work in their ancient browser on
their ancient OS that is full of malware and virii. Half of what I
love about Rails is getting all this cool js stuff for free. Writing
Ruby that writes js just feels good.

Another PHP thingy I’m sorta watching a bit is the Zend Framework.
It’s very heavy on the OO-ness, and I’d expect nothing less from Zend,
but it has no js integration I could find. Rumor has it IBM is
supposed to be committing a bunch of js stuff to the code base soon,
but Rails is already here and works great.

PHP is great, and I can easily see myself using it for years to come,
but I don’t do much with it outside of the office anymore. All my
hobbie coding time is spent with Rails.


Greg D.
http://destiney.com/

On 1/31/07, Greg D. [email protected] wrote:

On 1/31/07, mike [email protected] wrote:

I highly recommend the “Agile” book, which I’ve been devouring over the
past few days.

I’m only a few days away from finishing 2nd edition myself.

I have only just started, don’t spoil the ending!

For me I hate writing js. I hate debugging js. I hate helping
clients understand why my js doesn’t work in their ancient browser on
their ancient OS that is full of malware and virii. Half of what I
love about Rails is getting all this cool js stuff for free. Writing
Ruby that writes js just feels good.

I would only question that in, though I really like RoR - I absolutely
despise the inline JS that is used (though I know there is a plugin to
make it unobtrusive). It’s not free - you still need to know what you
are doing, though.