PHP vs. Python/comp.lang.php?
phil hunt
philh at comuno.freeserve.co.uk
Fri Nov 23 11:41:55 EST 2001
On Fri, 23 Nov 2001 15:05:19 GMT, Suchandra Thapa <ssthapa at classes.cs.uchicago.edu> wrote:
>Max M <maxm at normik.dk> wrote:
>>I think you will find that the general concensus is that Python is a
>>"complete" language. Which PHP is not. Python can be used for both web
>>scripting and, shell scripting, application development, small tools and gui
>>apps. And is very good at all of them. Wheras PHP is only useable for
>>scripting web pages.
>
> PHP has a command line interpeter so it can be used for scripting
>and the like. I believe there is even a gtk library so it's conceivable to
>create a gui app in php. However using php for something other than web
>scripting is very rare.
That's because PHP *as a language* isn't that good. Python is a much
better GUI scripting language.
PHP is nice for web pages, but that's all it's nice for.
> However, PHP has some fairly large flaws in comparision to python.
>For example, using a variable that has never been declared or initialized will
>silently be treated as using an empty string
It wouldn't bother me if Python did this.
> (e.g. if you make a typo while
>entering a variable's name, you won't get an error). PHP also has some issues
>with case sensitvity. Variable names are case sensitive while function names
>are not. In addition, function calls are handled poorly. If you call a
>function with 3 parameters when it was declared with less than 3 parameters,
>php will silently ignore the extra parameter.
PHP is also ugly. As an example, compare:
PHP: $object->$member
Python: object.member
--
*** Philip Hunt *** philh at comuno.freeserve.co.uk ***
More information about the Python-list
mailing list