Home > > Home

ForumsHome

This Question is Possibly Answered

1 "correct" answer available (5 pts) 2 "helpful" answers available (4 pts)
Post a new topic
4 Replies Last post: Jun 3, 2008 11:16 AM by xenopod

Ruby on Rails vs. PHP

May 27, 2008 1:39 PM

Click to view akgold's profile Founders akgold 51 posts since
Jul 19, 2007
Any thoughts on which is the preferred platform? I have heard two camps extolling the virtues of both.
Report as inappropriate
Click to view SolveIT's profile Professional SolveIT 3 posts since
May 27, 2008
1. Re: Ruby on Rails vs. PHP May 27, 2008 2:49 PM
Ruby on rails is relatively new technology. It's a framework that is build on its own language. So, the learning curve and availability of resources is pretty limited. The advantage is that it is structured which eases mantenance and reduces development time.

PHP is more tested, been there for a long time and purely a language. There is no structure to it and a lot depends on the ability and expert level of PHP programmer writing the code.

Ruby on rails is getting popular but at this time, i would recommend PHP.

Vasu Ram
CEO
SolveIT Inc
www.solveitcorp.com
508-898-0082 (112)
Click to view akgold's profile Founders akgold 51 posts since
Jul 19, 2007
2. Re: Ruby on Rails vs. PHP Jun 2, 2008 9:08 PM
in response to: SolveIT
Thanks SolveIT. Your answer shows a clear understanding of not only the differences, but the core reasons. I appreciate your advice.
Click to view xenopod's profile Mogul xenopod 109 posts since
Dec 28, 2007
3. Re: Ruby on Rails vs. PHP Jun 3, 2008 11:10 AM
Ruby on Rails (RoR) is a framework for web applications. It uses the Ruby which is a full programming language. This means you can write Ruby programs that work on the server interacting with the OS itself instead of the webserver module and send result data back to objects written RoR in the webserver and see the results through a web application.

PHP is a server side scripting language not a full programming language. This limits what PHP itself can do to things you can do inside of your webserver. However this limit isn't different from what RoR can do its own without extensions calling to outside programs. It should also be mentioned that when PHP is linked to a shell it can run arbitrary code in the OS outside of the webserver just like Ruby and RoR can.

With RoR it is considered generally easier to do build multiple things that do similar things since the framework is premised around a notion of "Don't Repeart Yourself" (DRY). This is accomplished by the uses of classes and objects in Object Oriented Ruby.

While RoR can do what the framework was speified to do very well it is tedious and cumbersome to write code within the framework to do something it wasn't intended to do. However similar things can be said about other frameworks for other languages if you learn how to write within a framework and not how to properly program or properly implement in a language.

So how do you pick a preference? Well if you are a web developer and you need to create dozens (or hundreds!) of websites that essentially do the same thing then it would probably make sense to use Ruby and RoR to build all of your websites. Since you could then just copy and paste your code for each implementation and throw on a different interface and only those who can read the script code will ever know they were built using the same code. However, again, it should be said many often already do this inside PHP. If you are a single company building apps and sites for your own company's use then it doesn't really matter what platforms you choose, pick things your programmers already know well so they write the best code possible. Unless they have an excellent background in the theory of programming languages don't make them learn a new language! They already write their best code in whatever language they know, don't compromise quality just to be trendy.

So we'd need to know more about what your specific situation is before I could really refer one or the other to you. Do you already know Ruby or PHP? Are you a web development company or a programmer working for a company that isn't a web development firm? What is it you plan on coding and have you looked into the RoR specification about what it is intended to do?
Click to view xenopod's profile Mogul xenopod 109 posts since
Dec 28, 2007
4. Re: Ruby on Rails vs. PHP Jun 3, 2008 11:16 AM
in response to: xenopod
I should expand on this part "With RoR it is considered generally easier to do build multiple things
that do similar things since the framework is premised around a notion
of "Don't Repeart Yourself" (DRY). This is accomplished by the uses of
classes and objects in Object Oriented Ruby."

That was important, because when RoR was first being used in production PHP was in a version that had very limited object orientation. PHP before version 3 did not have objects. PHP 3 had very basic objects. More current versions PHP 5 and 6 have essentially the same object orientation as object oriented ruby.

So before PHP had adopted object orientation and better implemented it in the language. Ruby and RoR were promising alternatives to PHP since they could do things PHP could not. That is no longer the case so again the choice between the two is generally more for personal preference than for any actual production difference.

Most Recent Forum Posts

Legend

  • Open Question
  • Answered Question
  • New content since your last visit
  • Updated content since your last visit
  • Content you have read