PHP or Rails for large project? Advice needed

Discussion in 'Web Design and Development' started by Super Macho Man, Jun 20, 2008.

  1. Super Macho Man macrumors 6502a

    Super Macho Man

    Jul 24, 2006
    Hollywood, CA
    Here's my background. I'm professionally employed as a PHP developer with about 1 year of full-time PHP experience. I like to think that I write reasonably good PHP - at least I make good use of OO patterns, separating logic from presentation, etc.; not strictly MVC, but I can write a decent PHP app. I don't hate PHP nor am I in love with it. I do not have a CS degree and am mostly self-taught. I'm also competent with relational databases and have a decent grasp of SQL.

    I'm exploring an app to develop and sell/support commercially - kind of like a hybrid CMS/image gallery. It would be specialized, however, for a very small market. My main requirements from a language are:

    - Rapid development
    - Ease of programming for non-CS geniuses
    - Maintainability over the years
    - Professionalism

    Like I said, this will be a fairly specialized/complex app. I may be doing some SQL/XML stuff with Postgres/Oracle, I may be doing lots of complex joins, etc. Installation may not be trivial and that's OK.

    So, if anyone reading this has "been there," done the PHP thing, done the Ruby thing as well... what would your advice be? Would you say it would be worth it to learn an entirely new language to start on something like this? Or would it be better to leverage my existing PHP/SQL knowledge? Is Rails an appropriate candidate language for such a project? Will I ever get a positive return on investment from learning it? I do write PHP all day at work, so that is the language I'm stuck with for 8 hours of the day. I'm trying to choose what I will be stuck with for 4 hours in the evening. :)
  2. MacDonaldsd macrumors 65816


    Sep 8, 2005
    London , UK

    I have never developed a huge project with Rails or PHP but can programme will in both. Rails is a really good framework as long as you do what it wants (each table has a ID column, foreign keys have a specified name etc etc), and its main benefit is that it forces you to develop in a MVC style, which PHP does not.

    You can write SQL queries directly, but normal you don't as the framework takes care of all them using all of the naming conventions.

    For your 4 bullet points Rails is the better option, but to be honest if your good at PHP its probably best to stick with that as it is more flexible and you already know it.
  3. macsig macrumors regular

    Oct 27, 2006
    Marina del Rey, CA
    Rails is much better. it is as flexible as PHP.
    It follows the "convention over configuration" paradigm and thanks to that it is very easy to have a fully functional application in few time but if you want to configure it (for instance you can named the foreign keys as you wish, you have just to specify it on your model declaration, that means you have to add 2 words !!!)
    It's almost 1 year I work full time with Rails and I'm very happy with it.

    If you have to start working at a new project I suggest you to using BDD (RSpec). This approach has changed the way I develop applications in a much productive way, delivering quality software.

    Hope this helps
  4. exabytes18 macrumors 6502

    Jun 14, 2006
    Suburb of Chicago
    Disclaimer: I write in PHP and Java.

    For a quality product, I'd go with the language you are most comfortable with. To me, it doesn't make sense to learn a new language for such a project. You aren't instantly going to be an expert with RoR like I suspect you are with PHP. I've been coding for awhile, but I do recall how my coding style / conventions / etc evolved as I mastered a language. This isn't to say that you couldn't accomplish the same thing with either language, but which would you feel more confident selling and supporting in the long run?
  5. Luveno macrumors member


    May 12, 2006
    Nova Scotia, Canada
    Here's how i'd break down the four bullets:

    - Rapid development

    Rails might lend itself to slightly quicker development (as it's a framework designed for it), but you can make use of libraries/frameworks in PHP to make things equally as quick. On top of that, you don't need to learn PHP. I'd say PHP coupled with PEAR and something like the zend framework would likely be the fastest way for you to get up and running. That's you personally, as a person who doesn't know ruby yet.

    - Ease of programming for non-CS geniuses

    Both PHP and Ruby are great languages to write in. If you taught yourself PHP you can teach yourself ruby. The only advantage PHP has over ruby in this aspect is that you already know it, and can dive right in, instead of learning as you go.

    - Maintainability over the years

    Good code is good code. If it's clean, broken apart properly so that you don't repeat code where you don't have to, and well documented, language has no little bearing on this. If you were to write for PHP 5.2.6 (current as of today) your code will likely run on PHP 5.x.x for the next few years without issue. When PHP 6 comes out, you'd probably have to upgrade your app to meet whatever php 6 changes. Ruby 1.8.7 was released a week or two ago, and it was only compatible with Rails 2.1 and greater, which would mean to keep your app up to date with Ruby/Rails might require a little more frequent attention to maintain. I'm not saying PHP won't have problems with PEAR libraries/frameworks requiring latest/greatest, but personally i've seen more "you need to upgrade to version x" with Rails.

    - Professionalism

    This goes hand in hand with your manageability point. Some of the largest web apps in the world run on PHP, and while it's still young, Rails is gaining some ground in larger apps as well. They obviously both work, and one isn't better than the other. If you write a stable, secure app that developers can work on easily, that's your professionalism from a development standpoint. It's unlikely that you'd hear "Oh, that looks like a neat app, but the bonehead uses PHP. What an amateur.", and likewise for rails.

    All of that being said, it comes down to this: If you need to do it quickly, it will be faster for a PHP programmer to write in PHP than to learn Rails. If speed of development/deployment isn't an issue yet, pick whichever one interests you more. They both have unique challenges/rewards that you will uncover.
  6. ChicoWeb macrumors 65816


    Aug 16, 2004
    One thing to think about... Is this going to be a remote system or installed on clients servers? Keep in mind you need a special ruby framework. PHP is readily available and could be what you're looking for. Hard to say without knowing the scope of your project though.

Share This Page