What can Ruby do that PHP can not?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I've been a C/C++ programmer 12 years, and a PHP programmer 6 years and
did some Java in between.

Currently there's a job opening that's attractive to me, but I would
have to learn Ruby (and the framework Rails.)

I've looked at some Web references, and I just don't get what the big
deal is about Ruby.

So I'm wondering, "What can Ruby (on or off Rails) do that PHP 5.x can not?"

(Maybe I'll try to get the job and then convince them to let me use PHP... :-)


Re: What can Ruby do that PHP can not?

Dave wrote:
Quoted text here. Click to load it

Try asking a ruby newsgroup about the differences. I have never used it.

** disclaimer below contains a rant and is nothing personal

Seriously I would be asking myself if I want to work for them or not.
Business usually won't let you change languages because you prefer
X over A .They will have an existing frame work and projects they are
already using .If they are offering to teach you ruby on rails , do it
and at worst you will have another tool under your belt.

Personally I feel your lucky that they are offering to teach you
something , many people have to go and pay to learn the tools first,
then be good at them,  before a business will take you on.

regards trookat

Re: What can Ruby do that PHP can not?

Quoted text here. Click to load it

Seems like a sensible response.

Certainly a lot of PHPs features can be double edged and there are
some short comings but on the whole I like it. Ruby might do a better
job in some areas. Its important to differentiate between Ruby and
Ruby-on-rails though.

This makes interesting reading:


As I've posted here before - I think that in order to develop as a
programmer you **do** need to immerse yourself in different paradigms
and languages - something the author of the article above hints at. So
a situation where there is one ideal language for programming would
directctly be a major setback for programing in general.



Re: What can Ruby do that PHP can not?

Quoted text here. Click to load it

The big deal is not so much about Ruby in general as it is about Ruby
on Rails (RoR).  The proponents claim that RoR cuts development times
by orders of magnitude.  The opponents generally agree, but add, "only
for trivial applications which need not scale".

Quoted text here. Click to load it

Eat away system resources.  Alex Payne, a developer at Twitter (which
developed the namesake application, which is reportedly the largest
RoR application deployed to date), has this to say on performance and
scalability of RoR:


All the convenience methods and syntactical sugar that makes Rails
such a pleasure for coders ends up being absolutely punishing,
performance-wise. Once you hit a certain threshold of traffic, either
you need to strip out all the costly neat stuff that Rails does for
you (RJS, ActiveRecord, ActiveSupport, etc.) or move the slow parts of
your application out of Rails, or both. It's also worth mentioning
that there shouldn't be doubt in anybody's mind at this point that
Ruby itself is slow...  If you're looking to deploy a big web
application and you're language-agnostic, realize that the same
operation in Ruby will take less time in Python.

[End of quote]

http://www.radicalbehavior.com/5-question-interview-with-twitter-developer-alex-payne /


Re: What can Ruby do that PHP can not?

For scalability, I'm seriously interested in the combination of Mnesia
(DB) and Yaws (server) under Erlang, which is a very productive
language in its own right. Ruby is a very good language, but it's
seeing a backlash right now for two major reasons:

1. Performance
2. Like PHP, it lets you shoot yourself in the foot. Unlike PHP, it
lets you chop off or disfigure your leg as well. Some of the things
that make Ruby so powerful are its very downfall when working in large
teams unless developers are _extremely_ disciplined.

That's hearsay, of course. Most of my experience is with PHP, Python,
and Erlang. If this opportunity is with a small shop and experienced
Rubyists, it sounds great. If it's a larger, older company tackling a
fading trend, I'd steer clear because it would be a real hair gray-er.
Worst case scenario, you expand your skillset.


Quoted text here. Click to load it

Site Timeline