Ruby On Rails or PHP?

DeluxeNamesDeluxeNames AdminAdministrator
I'm glad to see we have some Ruby on Rails experts here like Nuvo. This year, my New Year's resolution was to learn ROR within 3 years. As most of the scripts I try to use are written in PHP, I have to admit that I've been doubting whether learning PHP would be more productive for the casual coder. I'm never going to be a hard-core coder, I just wan to know enough of one language, to be able to understand/modify/fix scripts.

Learning both PHP and ROR is not an option because of time issues, what do you guys think is the better language to learn in my situation?

(I do understand that Rails is a web application framework, and that Ruby is the acutal language.)

Thanks

Comments

  • NuvoNuvo Forum Leader VPS - Virtual Prince of the Server
    I'm not a Ruby on Rails expert by any means, but I am getting to be decent enough with it for what I want to do.

    I prefer Rails because I find PHP scripts messy sometimes.
    Rails code can often be very easy to understand once you know the basic syntax.
    While PHP might have something like:
    reverse(stringvar);
    
    Rails has:
    stringvar.reverse
    # or
    "this is my string".reverse
    

    Rails is also pretty good at handling AJAX and has nifty little features like pluralization (you type pluralize(2, "person") and it'll output "people").

    It's worth looking into Ruby on Rails to see if you can live with it's non-C like syntax and such as some do find it a bit alien (I did at first, but I decided to go back and I found it more readable).

    If you're only looking to modify existing stuff, PHP might still be a more viable option as Rails doesn't seem to use the old style of stealing a bit of code from one place and bunging it into another script, it has a plugin system and engines, which mean you can get extra's like textile support easily (textile and markdown are actually supported by Ruby GEM's called Redcloth and Bluecloth, so as long as your host has them, you can use them in any project, but engines are installed into the application, so your host doesn't need to have them).
    While you can still find snippets of Rails code on the net (technoweenie just gave me the code I needed to get code highlighting working in my app), there's still the pre-built engines, GEM's and plugin's if you can't get something to work.

    If you're interested in the Rails framework, it might be worth looking into Cake or Trax, which are PHP web frameworks aiming to do for PHP what Rails has done for Ruby (but with less OOP support as Ruby is more OOP than PHP5).
    PHP, CSS, XHTML, Delphi, Ruby on Rails & more.
    Current project: CMS Object.
    Most recent change: Theme support is up and running... So long as I use my theme resource loaders instead of that in the Rails plug-in.
    Release date: NEVER!!!
  • DeluxeNamesDeluxeNames Admin Administrator
    Thank you for this answer Nuvo.
    The Cake & Trax application framework for PHP sound like just what I'm looking for. I'll take anything that will make PHP easier to understand/read.

    What do you guys prefer between Cake and Trax?
Sign In or Register to comment.