PHP vs Rails Vs ?

Discussion in 'Web Design and Development' started by davegreb, Nov 1, 2007.

  1. davegreb macrumors newbie

    davegreb

    Joined:
    Nov 1, 2007
    Location:
    Atlanta,GA
    #1
    Hi,

    I'm a previous user of perl and want to write a few web sites that require database work.

    Perl is old hat now, so what do I move to? I've heard somethings about Ruby , but not too much. PHP is obviously easier to move to coming from the Perl background.

    Is there anywhere I can compare the two?

    Any other options? My background is database development as well as perl.

    What about databases? I'e used mysel in the past but have an oracle background. Hows mysql compare with postgres? Hosting companies always seem to support mysql and less so Postgres?

    Thanks
    Dave
     
  2. werther macrumors regular

    Joined:
    May 15, 2006
    #2
    PHP and Rails are two completely different things. PHP is a scripting language where as Rails is a framework based on Ruby. There are frameworks for PHP as well, e.g. cakephp.

    As to which you should learn it depends on the scenario. I would recommend learning PHP first. I use PHP on smaller sites. If the client wants a simple CMS to update news and events, I use PHP. I would not see the point in taking the time to set up a virtual server for such a basic site. If the site is much bigger than I would use Rails.
    -this is a very simplified explanation I know. (I am not saying PHP is not capable of running larger sites, this is only my opinion)

    One tool does not fit every job.
     
  3. Mantat macrumors 6502a

    Joined:
    Sep 19, 2003
    Location:
    Montréal (Canada)
    #3
    Rails can handle super small website with ease. Just look at the blog exemple on the www.rubyonrails.com .

    Rails is hand down a superior framework because it is powered by one of the most dynamic language, ruby.

    PHP can be faster in general but with good design and memcached Rails can be as fast so speed isnt that relevant.

    I think the most important factor is, how much energy you want to invest in your webdev learning. Rails can be used without much knowledge of Ruby but you will be stuck with basic operations, and learning Ruby without a good OO design background isnt trivial. Rails has a lot of shortcuts that can speed up web developement to a ridiculous speed. The Beast forum engine has about 500 line of codes, that is a lot of functionalities for a small amount of code!

    An advantage of PHP is that the user base is much larger. So there are most plugins made for it, which at some time can be a curse since you dont know which one is the "best" to pick.

    Finaly, there is a third option, learn DJango. It is a framework made with Python and it is the only framework that (IMHO) can stands againts RoR for that level of application development.
     
  4. davegreb thread starter macrumors newbie

    davegreb

    Joined:
    Nov 1, 2007
    Location:
    Atlanta,GA
    #4
    I guess that should have read PHP vs Ruby Vs ???

    Thanks for the tips so far. I have also heard the Ruby route makes things quicker, which is a big plus, esp as it can automate a lot of things once I have the database schema created (the easy part for me)

    The websites will be more than blogs and forums, but quite a few database tables which users populate through forms and the need to have queries run against to create pages, so something that can make use of html templates is important

    My concern with Ruby is its cutting edge and you get a lot of people jump on board just for that fact and maybe not because it's an improvement
     
  5. werther macrumors regular

    Joined:
    May 15, 2006
    #5
    ....Geez, I thought I was going to be critiqued by the PHP crowd not the Rails.
    I know Rails can handle smaller sites. Of course rails can handle small sites. If I have a client who owns a small business and would like a web presence (not 2.0) and be able to edit small portions of the site, I can accommodate their budget better by offering a PHP site as there are many, many hosts that provide PHP/MySQL support on the cheap.
    -this reason however is becoming less and less relevant each passing day with more and more hosts offering rails support (asmallorange.com)

    -this is a legitimate concern, I felt the same way. I too learned ruby before I dove into Rails and would suggest that to anyone seriously considering learning Rails. Writing and reading ruby code is fantastic. The real thrill for me though was Rails. Once I started learning it my concern of whether or not Rails was a fad disappeared.
     
  6. werther macrumors regular

    Joined:
    May 15, 2006
    #6
    dammit! I had not heard of that so I tried to look it up and landed in a beastiality forum. :eek:
     
  7. davegreb thread starter macrumors newbie

    davegreb

    Joined:
    Nov 1, 2007
    Location:
    Atlanta,GA
    #7
    werther..not heard from you in a while, are you still in your new found forum ??:D:D:D
     
  8. werther macrumors regular

    Joined:
    May 15, 2006
    #8
    hahaaaa! I read that quietly to myself and burst out laughing. My co-workers were looking at me.......so I had to sign out of the beasty forums.
     
  9. Winterfell macrumors regular

    Joined:
    Apr 3, 2007
    Location:
    Tulsa, Oklahoma
    #9
    I think the big thing you should think about is how you envision the websites in the coming months/years. If they're going to remain small, and you want to experiment with RR, go for it. It's flashy, and really is kind of an "in" technology these days.

    But RR does not scale well at all. Just look at some examples of larger sites that got in on the RR train and are paying for it now, because it has trouble handling large amounts of traffic. Sites like Twitter come to mind.

    This is where PHP excels. Scalability. Terry Chay says it best: "PHP may be the best web language out there. But it certainly isn’t the only one. It’s one approach, one that stresses configuration over convention, stupidity over smarts, practicality over elegance: it’s one ugly mother f—er that gets sh-t done."

    That's where I would start. Then you can move on from there.
     
  10. werther macrumors regular

    Joined:
    May 15, 2006
    #10
    The twitter problem from what I understand was more of a database problem which was resolved by switching to memcached. Facebook had similar issues before switching to memcached and they are PHP.
     

Share This Page