Jump to content



Photo

A General Question 'Php Vs Ruby'


  • Please log in to reply
4 replies to this topic

#1 kwandoa

kwandoa

    Member

  • Members
  • PipPip
  • 43 posts

Posted 19 April 2013 - 6:35 AM

I guess you've been asked this many times...but amuse us this one time.

 

In your opinion, if you met a beginner web developer and had to advise him/her on what Web Developing language to begin with, keeping in mind the Framework applications that are out there.

 

Would you recommend PHP or Ruby?

 

:D


  • 0

#2 Larry

Larry

    Administrator/Writer

  • Administrators
  • 4921 posts
  • LocationState College, PA (USA)

Posted 19 April 2013 - 8:02 AM

I would recommend PHP, without a doubt.


  • 0

#3 erikvail

erikvail

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 5 December 2017 - 8:35 AM

I would recommend reading the following article of Alan Storm regarding the difference between Php and Python 

Some of the these aproach problems were overcome by introducing the namespace concept in php.

These differences are due to the development of the PHP language which was not a designed from start but evolved naturaly.

 

An example with namespaces in php showing how we can solve nowadays these fine pecularities

<?php

namespace Earth;

    #File: hello_earth.php
    function hello()
    {
    echo "Hello Earth! \n";
    }
    
    hello();

?>
<?php

namespace Mars;

#File: hello_mars.php
function hello()
{
    echo "Hello Mars! Mind the germs.  \n";
}

hello();

?>
<?php

    namespace Solar;
    
    include 'hello_earth.php';
    include 'hello_mars.php';

    echo "Starting up a solar system \n";
    
    /* Usage with use
    use Earth;
    use Mars;
     
    Earth\hello();
    Mars\hello();
   */
    
    \Earth\hello();
    \Mars\hello();
    


?>

  • 0

#4 erikvail

erikvail

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 5 December 2017 - 8:50 AM

Though my prev. post targets python it can be true for ruby also.


  • 0

#5 Larry

Larry

    Administrator/Writer

  • Administrators
  • 4921 posts
  • LocationState College, PA (USA)

Posted 5 December 2017 - 1:26 PM

Agreed. Thanks for sharing!


  • 0