Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: Perl vs. PHP

by perrin (Chancellor)
on Aug 13, 2004 at 20:00 UTC ( [id://382822]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Perl vs. PHP
in thread Perl vs. PHP

Classes are better, but they still have no namespaces. Everything is in one global namespace.

Replies are listed 'Best First'.
Re^4: Perl vs. PHP
by adrianh (Chancellor) on Aug 14, 2004 at 10:34 UTC
    Classes are better, but they still have no namespaces. Everything is in one global namespace.

    Just being devils advocate for a minute: How is this different from Perl?

    Perl mangles the package and class concepts together - it doesn't really have namespaces either (in the sense they are used in C#, C++, Smalltalk, etc.)

      It's different because I, as a Perl programmer, don't have to worry about the next function name I choose colliding with any of over 3000 built-ins or any function defined in any file I might ever want to include.

        It's different because I, as a Perl programmer, don't have to worry about the next function name I choose colliding with any of over 3000 built-ins or any function defined in any file I might ever want to include.

        Don't PHP classes solve exactly that problem? For example:

        <?php class foo { function hello() { print "hello world\n"; } } class bar { function hello() { print "greetings planetary body\n"; } } foo::hello(); bar::hello(); ?>

        Can't you treat PHP classes like Perl packages?

        (Disclaimer: I'm not a PHP coder so I'm probably missing something blatant ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://382822]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-24 12:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found