SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Member
    Join Date
    Dec 2004
    Location
    CT
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Managers View comparison php ruby/rails

    First a confession, Iím not a programmer, at least not in the last 10 years or so. I do read many of the books both PHP and recently Rails, just so I am aware of what the tools are capable of. I am a manager of a small development company with a couple of web developers. We have been using PHP for almost everything but as a manager I have a question. It seem like every time I have a PHP programmer look at program written by another programmer the style is so completely different. Custom built libraries, database wrappers vs. native calls, templates vs. no templates, OOP vs. procedural etc. etc. In many cases it is too expensive to make any changes to the application because getting to know the code base takes too long.
    Based on my reading of the Rails book it looks like Rails may impose enough structure that the number two programmer may make changes to an existing program with a lot less study time than for a typical PHP program.
    Do you think this is true? If it is true I will encourage my guys to migrate over to Rails even though I expect a productivity slowdown during the learning curve.

  2. #2
    SitePoint Zealot
    Join Date
    Jul 2005
    Posts
    124
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As long as the previous developer wasn't a complete Rails idiot I'd have to agree.

  3. #3
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Rails is going to enforce a certain level of quality (object oriented code, MVC pattern), but that's about it. The best way to enforce code quality is to create and enforce a standard for your coders, and that won't be solved by switching frameworks.

  4. #4
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Unit tests help a lot. I've not yet figured out why, but if you write unit tests, you'll end up with clearer code. Rails encourages unit tests.
    Last edited by Fenrir2; Apr 8, 2006 at 12:10.

  5. #5
    SitePoint Member
    Join Date
    Dec 2004
    Location
    CT
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Vgarcia: Do you recommend any php or rails standard. Do you have any samples handy you would be willing to share. As a manager and former programmer I feel a little out of place insisting on something specific as many choices are neither right or wrong but a matter of preference. It does make it a lot harder for maintenance .

  6. #6
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you want to have micro coding standards like "braces after if on the same line", there is a very good solution: emacs. Emacs is an editor with special support for virtually every language through "modes". If you're coding Ruby code, you download ruby-mode. This mode handles indentation, and many other things which are normally done in standards. This will make sure that everyone (if they're using emacs) has the same style.

    But this in only a solution for coding standards, not for libraries. The good news is that Rails encourages a certain style:

    database wrappers vs. native calls, templates vs. no templates, OOP vs. procedural
    Rails has a built in database wrapper, template engine, and uses OOP. You COULD do other things, but this is not the obvious path. You have the freedom if you want (this is needed in special situations), but nearly everyone uses the built in template engine, database wrapper, and OO. So this is "cross programmer portable".

    Before jumping right into Rails, I would do a pet project in it first, so you'll know how to develop AND deploy. There may be other issues because Rails is so young.

  7. #7
    SitePoint Member
    Join Date
    Dec 2004
    Location
    CT
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I love this phrase: "cross programmer portable".
    Without any real experience it seems as though a PHP program can be just about anything from very bad to very good. The vast majority of PHP code I've read is training code and would not be suitable for production. It looks like the Rails framework strongly encourges even a beginning programmer to use at least adaquite style.

  8. #8
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know if it works, but Rails and Ruby encourage beautiful code.

  9. #9
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by davidpm168
    Vgarcia: Do you recommend any php or rails standard. Do you have any samples handy you would be willing to share.
    I'm not going to tell you that this
    Code:
    function whatever(arguments)
    {
    
    }
    is any better than this
    Code:
    function whatever(arguments) {
    
    }
    That borders on micromanagement in my opinion

    What I was talking about was setting a baseline with your programmers, with regard to what libraries are to be used for database calls, templates, etc. For example, with PHP you could say something like "use smarty for templates and use PEAR DB:ataObject for all database interaction". This way, all of your programmers learn and work with the same APIs, shortening the learning curve.

    The nice thing about Rails is that all the database libraries, templates, etc. have been chosen for you. If you and your programmers can live with that (or any other framework that's as complete), it can simplify your life

  10. #10
    SitePoint Member
    Join Date
    Jul 2005
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb Use one of your programmers

    How about using one of your most trusted and reliable programmers to set the standards together with you?

    He could be the first to switch to rails on a project and from there be involved in the training of the others.

  11. #11
    SitePoint Member
    Join Date
    Dec 2004
    Location
    CT
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    >>>>
    The nice thing about Rails is that all the database libraries, templates, etc. have been chosen for you. If you and your programmers can live with that (or any other framework that's as complete), it can simplify your life
    <<<<

    This is what I gathered by skimming the Agile book. My problem is that my programmers and frankly I believe most programmers, including myself in a past life, change their style and favorite libraries almost every project. I have a hard time working with one of my own projects if it is only a couple years old. If you were to ask me if it would be possible for a changing large group of programmers to create a complicated program like an operating system or web server I would say no. Every new programmer would want to refactor the old code before doing new work and the job would never get done. Obviously Iím dead wrong. Itís the old bumblebee syndrome. Linux canít exist anymore than bumblebees can fly.
    This being the problem the fact that the tools have been chosen in Rails and hopefully will evolve at some reasonable pace looks good to me as a manager.
    Here is the real problem.
    If you want to be a Linux contributor you probably have to spend at least a year really digging into the code before you can contribute anything of high enough quality to be accepted. Certainly worth it for a code base worth millions.
    Most of my projects are 5g to 50g. Iím hoping that rails will level the playing field so that I can sell $1,000 worth of modifications to a site and not have it cost me $5,000 due to ramp up if the original programmer is not available.
    So far it seems as everyone is agreeing with my original guess. Rails encourages good code that looks similar and should be easier to pickup in the middle.

  12. #12
    SitePoint Enthusiast Ilija Studen's Avatar
    Join Date
    Oct 2003
    Location
    Serbia
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can also check out some PHP projects:

    * Zend Framework - work in progress, but with strong community behind it already. It will most likely be primary PHP framework in the future.
    * Symfony - popular PHP5 framework. A lot of code generation and YML files...
    * CakePHP - looks like Rails, but not that complete.

    Not all PEAR packages have the same quality because there are many programmers involved in them, some of them are PHP4, some PHP5 etc. Really good package of common classes is ezComponents. And the good thing is that they are well designed and made by one team of programmers. PHP 5.1+


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •