Ruby v/s PHP

Which is better Ruby or PHp?
watch this video of comparison between this languages

I would definitely argue that it all depends on what kind of project
you are currently working on,.
PHP is superior at some things while Ruby (on Rails) is more
convenient for other kinds of stuff.
What is your stance?

Don't ever compare languages, they all have uses. I think that for
almost everything ruby is better, but that doesn't mean that I will
never use PHP again.

Please keep in mind that PHP is built for the web and is capable of being used in normal environments.

Ruby is built as a general purpose language and has libraries for web site development.

So comparing the two isn’t exactly oranges to oranges, more like oranges to tangerines.

I personally loathe PHP and have vowed to never develop with it again, but to each his/her own.


Don’t ever compare languages, they all have uses.


I think that for

almost everything ruby is better

Well that didn’t last long.

I have been working with PHP since 96-97.. since the 3.0 days and have
watched it evolve into the OO langauge it is today.

The language was great, but as my skill increased with the lanaguge,
and applications got more complex, the directory structure was moulded
into a custom MVC system. I checked out many other frameworks and
their structure at the time, such as Fusebox, which were great and
served their purpose.

Trouble was consistency. Being dropped into so many client projects
and each having their own choice of code layout and separation between
the sql, models, logic, and templates (views), it was fragmented at

With Rails you get the benefit of true consistency, at least as a
default. When it comes to implementation, again it's up to developers,
but at least you always know the inheritance you get when using a
Rails app. Not to mention the helpers and other add-ons that Rails

To go further on that, you also get Ruby, one of the most impressivel
languages in of itself.

Based on the above, ruby is the next best thing since the if statement.

But, that's not to mention that I have still found a need for PHP. As
I mentioned with Rails, it inherits a MVC directory structure,
testing, and tons of other libraries that may prove to be unused if
you are simply wanting something as simple as a redirect script.

Consider the following. You have a new ViewVC setup
( and you want to redirect them to the
/view directory when they hit the index due complexity behind having
the root path tie directly into the ViewVC browser.

That being said, choices..

a) Setup an entire Rails instance to do a simple redirect plus figure
out the complexities behind having both ViewVC and Rails manage the
same domain. Painful to say the least.

b) Use a simple index.php with one line of code for the redirect.

header("Location: /view/");

c) Figure out some other way that may be better, but requires more
thought than needed.

So, even though Rails is by default the framework and Ruby being the
language I choose for almost everything. PHP definately has it's
place. It's simple, doesn't require a full MVC structure, and
definately has a much larger open source community behind it. May not
be as talented (*poke*) but is simply much larger. Not to mention the
tens if not hundreds of thousands of open source projects that are
freely available such as phpMySQL, Drupal, and osCommerce. These apps
have not yet been replaced by a Rails equivlent, so PHP without a
doubt has its place to date. This will definately change as time goes
on for some aspects, but to say that Rails is over and above the
answer to everything that a developer requires would be a lack of
understanding about what other langauges are meant for and how
effective they are at their purpose.



Consider the following. You have a new ViewVC setup
( and you want to redirect them to the
/view directory when they hit the index due complexity behind having
the root path tie directly into the ViewVC browser.

Not to nitpick but the correct/easiest way to do this would be to use
your web server's config file. A .htaccess for apache and a simple
redirect line in lighty would do the trick.



I tried the Redirect option using the apache conf and ViewVC didn't
like it much. Not running lighttpd in this case, didn't see a need for
2 web servers for this sort of thing.

As you pointed out, how I didn't wasn't so much the point but rather
why I did it. The options were Rails or PHP (and I tried Apache
directly first, but didn't want to spend anymore time debugging
redirect issues with ViewVC not being able to understand the hand
off). And Rails clearly was overkill.