Jump to content
Larry Ullman's Book Forums
Sign in to follow this  
kwandoa

A General Question 'Php Vs Ruby'

Recommended Posts

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

Share this post


Link to post
Share on other sites

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();
    


?>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...