Ruby on Rails Vs PHP

Discussion in 'Web Design and Development' started by MacDonaldsd, Jul 26, 2007.

  1. MacDonaldsd macrumors 65816

    MacDonaldsd

    Joined:
    Sep 8, 2005
    Location:
    London , UK
    #1
    I was wanting peoples views on which is the best to use for a small e-commerce site. I know they are not the same thing but in the end they achieve the same goal of dealing with a database. (correct me if im wrong)

    Im asking on behalf of a friend who will be building a small scale site as part of there final year project, for their degree.
     
  2. epochblue macrumors 68000

    epochblue

    Joined:
    Aug 12, 2005
    Location:
    Nashville, TN
    #2
    Well, some of that will depend on the languages your friend is familiar with or what they're willing to learn.

    My understanding is that RoR is great for building sites quickly, but getting the hang of RoR can take as some time. In contrast, PHP is pretty easy to pick up and use. Of course, if your friend doesn't know either, then there will be some ramp-up time either way.

    ...the short answer, is that there is no short answer here, but it'll probably be easier to pick-up and use PHP (especially if you're not familiar with Ruby's syntax, which can be daunting at first).
     
  3. werther macrumors regular

    Joined:
    May 15, 2006
    #3
    I am in the process of learning ruby. I still haven't used rails because I think it would be foolish not to know what it's built around and how to change its functionality.

    I use PHP and have to say that would be the way to go. I would compare it to learning the english language; the foundations are easy to pick up but the further you delve into it the more advanced it becomes.
     
  4. Mantat macrumors 6502a

    Joined:
    Sep 19, 2003
    Location:
    Montréal (Canada)
    #4
    I am totaly pro Ruby and what make things even worst is that I totaly hate PHP.

    That being said... If its only for a one shot thing PHP would be better simply because there arent any structure in the code base, you can hack the files and mix everything up. These are all the reasons why I hate PHP. It is too easy to make something that will be impossible to maintain in the long run. BUT, since it is just for a small project that will die as soon as it is reviewed, I guess PHP is good enough.

    But if this is part of a self teaching experience with plans to build more application in the future, RoR is by far superior.

    Another nice alternative is Python with the Django framework.
     
  5. Mac In School macrumors 65816

    Joined:
    Jun 21, 2007
    #5
    If simplicity is the only goal, nothing compares to ColdFusion.
     
  6. MacDonaldsd thread starter macrumors 65816

    MacDonaldsd

    Joined:
    Sep 8, 2005
    Location:
    London , UK
    #6
    They will be learning from scratch so that isn't an issue. Obviously goal one is the project but having learned an actual skill comes a close second.
     
  7. Aea macrumors 6502a

    Aea

    Joined:
    May 23, 2007
    Location:
    Denver, Colorado
    #7
    Rails is simply a Framework for Ruby, PHP is a "pure" coding language. If you want to code PHP like you do Ruby you can get a framework such as ZF or CI.

    Chances are they won't be allowed to use a Framework for PHP but completely ignore that Rails is a Framework. In this case I'd go for Rails, it's just easier to work with a Framework in creating an impressive script.
     
  8. savar macrumors 68000

    savar

    Joined:
    Jun 6, 2003
    Location:
    District of Columbia
    #8
    I've never used Ruby (or Rails), but I've used PHP quite a bit. As with anything, the language you pick is only a tool. PHP is very easily abused, and you need to know what you're doing or else you WILL write unsafe code. For e-commerce, unsafe code => potential lawsuit or criminal negligence charges.
     
  9. aaronbrethorst macrumors member

    Joined:
    Feb 1, 2007
    Location:
    Seattle, WA
    #9
    I've written a fair amount of code in both. PHP is extremely easy to pick up and start running with. RoR has a serious learning curve. If you're willing to invest the time, I highly recommend learning Rails, but it'll be relatively difficult if you don't have a formal computer science background and/or experience with developing applications under the Model-View-Controller (MVC) paradigm.

    That said, I highly recommend learning both eventually. PHP is nigh-on universal, and truly mastering both Ruby and Rails will make you a significantly better developer. I'd recommend experimenting with both for a bit and see which one you prefer.

    Additionally, if you happen to have a spare Windows machine or Parallels/VMWare Fusion on your Mac, ASP.NET is no slouch either ;) Plus, all the tooling you'd need to build a simple site is free.
     
  10. OutThere macrumors 603

    OutThere

    Joined:
    Dec 19, 2002
    Location:
    NYC
    #10
    I'd say start with PHP...I learned php about a year ago pretty much without any formal guide. I read a couple of basic tutorials, found some code snippets, played around and eventually figured it out. I'm putting the finishing touches on a totally custom CMS for a continuing-education organization this week. The real benefit of PHP, I've found is that there is so much documentation and stuff online. If you have a problem, google it and chances are, ten other people have had the same problem and solved it.

    I've been considering learning Ruby, but I think that really it'd be time better spent improving what I know in php.

    As someone posted above, I've read that Ruby is much simpler for people from a real programming background, which is something else about php: there are a lot more people from not technical backgrounds learning php, and, from what I've seen, that has resulted in a lot more 'normal-person readable' documentation.
     
  11. janey macrumors 603

    janey

    Joined:
    Dec 20, 2002
    Location:
    sunny los angeles
    #11
    Are you saying everything you need to play around with php and/or ruby or rails aren't? :p

    My 2 cents: whatever they're familiar with that will let them reach their goal. Otherwise, PHP for the simpler route, and ruby and rails if you have the time and are willing to spend the effort. The latter comes with a not insignificant learning curve.

    As for documentation and help for rails, I've always found the people in the #rubylang and #rubyonrails irc channels on freenode helpful, and http://api.rubyonrails.org/ as well. For a fun intro to ruby that I personally loved, check out why's poignant guide and for dead tree (or pdf, whatever you prefer), there's agile web dev with rails.
     
  12. MacDonaldsd thread starter macrumors 65816

    MacDonaldsd

    Joined:
    Sep 8, 2005
    Location:
    London , UK
    #12
    Im beginning to think from what ive read that PHP is the best route. My friend has experience with web design (HTML, CSS , Javascript) and SQL, so PHP seems the easiest option.

    Being a computer science student myself Ruby on Rails looks very appealing :D
     

Share This Page