Thread: Ruby vs PHP

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2007
    Posts
    27
    Rep Power
    0

    Ruby vs PHP


    Well, I've been amazed by the RoR articles I've read, and I'm thinking...
    Why am I using PHP, when RoR exists to simplify my life?

    Can anyone tell me why I might consider a swift migration to RoR, and what I might lose by (not) doing so?

    I must admit, I haven't done a lot of research on it, but just this once, if you don't tell me to google it, I'll be your biggest fan. : )

    Does my web server need a RoR module, or is there a RoR server, or what, like CFM?
    Cos I though CFM sucked, and PHP was king, cos it just worked with a basic Linux install. If I need a RoR install to get my RoR apps up and running, can anyone suggest a hosting company that either has such a thing installed, or would let me install it?


    Thanks. Y'all rock.


    JellyBelly
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 2006
    Posts
    2,270
    Rep Power
    1736
    > Why am I using PHP, when RoR exists to simplify my life?
    There's a number of reasons to use PHP. It's a business decision that is beyond your influence. You can make use of one of the PHP frameworks or code libraries. You don't need a full MVC system, and PHP is more flexible for the code you want to write. You are forced to use PHP by other tech constraints. Whatever.

    > I must admit, I haven't done a lot of research on it, but just this once, if you don't tell me to google it, I'll be your biggest fan. : )

    I know. But this is a professional IT forum, so you are held to certain requirements ;p

    > Does my web server need a RoR module, or is there a RoR server, or what, like CFM?

    I believe Rails has a small web server app you can run for testing purposes (but not sure). For actual production purposes, I think Ruby is commonly used with FastCGI. There should be mod_ruby as an option as well, but I don't know if that's a production level option. This is information easily found by Googling and reading the Ruby/Rails site, so I leave that to you.

    > If I need a RoR install to get my RoR apps up and running, can anyone suggest a hosting company that either has such a thing installed, or would let me install it?

    Do take a look at the Rails site. No really. They not only have a list of hosting companies, but sometimes indicate special promotion codes you can use to get discounts. Their table of information beats anything I can tell you in a paragraph.

    Yes, RoR is very nice. But it's not always the best choice. A number of factors go into choosing a language/framework/platform, and the best way you can make this decision is to learn as much as possible (with Google, reading).

    I know I pretty much told you to Google, but your questions were answerable by Google.

    Comments on this post

    • jg_abad agrees : Nice tips ..thanks
    When you ask a question, be prepared to tell us: what have you tried? If you think you don't need to try anything, we will never be interested in helping you. If you agree with the link, and you refuse to answer that question, you are being a hypocrite.

    Need help with broken code? Your question should be like a good bug report: (1) It has the smallest number of steps to reproduce the problem you see (2) It tells us precisely what you expected to see and (3) It tells us what you saw and how it differed from what you expected. We need all three to help you.
    Want better answers? Tell us what you Googled for and what steps you took to answer your own question.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2007
    Posts
    27
    Rep Power
    0
    Thanks for that. Your help is much appreciated.
  6. #4
  7. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Posts
    174
    Rep Power
    11
    Here's a parody of those Mac vs PC TV commericals from RailsEnvy.com . PHP vs Rails (also Java). This might help your sanity a bit.

    http://www.railsenvy.com/2007/5/15/h...n-rails-part-2

    http://www.railsenvy.com/2007/5/16/h...n-rails-part-3

    http://www.railsenvy.com/2007/5/21/h...n-rails-part-4

    Cheers
    sf2k
    Last edited by sf2k; July 17th, 2007 at 05:49 PM.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Posts
    366
    Rep Power
    10
    Originally Posted by JellyBelly
    Why am I using PHP, when RoR exists to simplify my life?

    Can anyone tell me why I might consider a swift migration to RoR, and what I might lose by (not) doing so?
    I can't tell you why PHP is better, but I can tell you that Rails is awesome because I went from knowing nothing about the internets (except for some wordpress PHP and a little HTML) to this in two weeks (NOTE: I've been busy and havn't had too much time to work out the many bugs. But still! Two friggen weeks!)



    Originally Posted by JellyBelly

    Does my web server need a RoR module, or is there a RoR server, or what, like CFM?
    Cos I though CFM sucked, and PHP was king, cos it just worked with a basic Linux install. If I need a RoR install to get my RoR apps up and running, can anyone suggest a hosting company that either has such a thing installed, or would let me install it?
    Many will refer you to Dream hosters, but I think they suck. Their tech support is no good, and their Rails hosting is half-assed (Please excuse the language).

    I use HostingRails. Their CS is great. By great I mean that you don't have to wait 24 hours to get a reply email. Usually in 30 minutes - 2 hours they'll reply and in 24 hours your problem will be solved. On top of all that their FAQ/Wiki pages are extremely in depth and useful (unlike Dreamhosters).

    -Amir
    I have summoned you here for a purpose
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Posts
    144
    Rep Power
    17
    I find this article interesting about ruby vs php
    http://www.oreillynet.com/ruby/blog/...ck_to_p_1.html
    i use railhosting.net has my hosting so far it has been good to me.
    Last edited by bunker17; September 28th, 2007 at 07:26 PM.
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2007
    Location
    /usr/bin/ruby
    Posts
    63
    Rep Power
    28
    No one has mentioned how new Ruby is compared to PHP, is it at the ranks of PHP yet? No, unfortunately no, will it be? Oh hell i hope so.

    RoR doesn't support many CMS projects currently, which i have found is a common problem when RoR newcomers email me. However its increase in available plug ins excites me and i think it will be a true contender in some time to come

    Comments on this post

    • Nesc agrees
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Posts
    73
    Rep Power
    10
    I thought about Ruby on Rails. I use Ruby mostly for scripting, but when I tried to use it as a web framework, I couldn't understand the damn thing. I set up a rails server, typed out a rhtml file, but it never got interpreted. Everything, including all my tags got output as raw text. I spent about 24 hours sifting through articles that made little sense, and seemed to be more about installing, and working from command line than anything. I eventually decided it wasn't worth the headache and stuck with php.
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2008
    Posts
    1
    Rep Power
    0
    as i knoiw guys ruby still not stable or smth like this ... so its hard to compare old but stable and new but kind of not stable language
  18. #10
  19. No Profile Picture
    Roobee On Railz Roolz!
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Posts
    139
    Rep Power
    0

    Ruby


    Ruby on rails is not Ruby, PHP is a language... CakePHP or CodeIgnighter would be a better comparison, where they are just as easy to use as Ruby on rails.

    Ruby as a language is purely object oriented where as PHP is not. It's really a matter of preference.

    Ruby has other frameworks, such as MERB.

    Don't limit yourself there, why not try Python using Django or Web.py?

    Really explore all of your possibilities, and dont become woo'd by hype.
  20. #11
  21. No Profile Picture
    Dev
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jan 2001
    Posts
    1,436
    Rep Power
    41
    The main advantage is switching to a strong [MVC] framework. PHP offers several of these as well - like cakePHP and Codeigniter. However, I personally think Ruby is much better suited for an mvc framework than PHP - if you get some good experience with Ruby you will find that it is extremely elegant and when you can make use of its advanced OO features, it can do a lot in very little code.
    There are many things that PHP just cannot do in a simple manner, and although some of the MVC frameworks try to duplicate what Rails does, you will find in the code that similar implementation in PHP can be quite ugly at times.

    I must say that the transition is a little more difficult than you may have heard. Deployment is a major issue (you don't just upload and run, like PHP), and once you break outside the very small scope of the screencasts you have seen (the 15 minute blog), you will find there is a bit of a learning curve. At times you have to fight with Rails, it is very rigid and difficult to bend. Though many say this is because it forces you to write good code.

    It's been said before - but Rails is just a framework. The actual language is Ruby, and as people have realized the power of this language, more and more frameworks have been springing up, some much smaller and more flexible than Rails.
  22. #12
  23. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2007
    Posts
    93
    Rep Power
    7
    i am not expert in ruby but i did the research for the same and i have read that code will be little bit complex in ruby with compare to PHP.
    My Favorite Web Development Company VITEB - Call us now @ +1 (408) 876-4660 for Business Inquiries.
  24. #13
  25. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2007
    Location
    kansa city
    Posts
    20
    Rep Power
    0

    Ruby on Rails is cool


    my local community college has a 3 day course for about 200 dollars , I am hoping to take this summer

IMN logo majestic logo threadwatch logo seochat tools logo