PHP与Python的比较 (PHP vs Python)

澳门新葡亰网站注册,在这里,我节录了一些关于PHP和Python比较的文章和讨论,让我们能从另外一个
角度来看待PHP的优点和缺点。同样作为一种脚本语言,底层同样是由C语言来开发的,Python是OO的,现在PHP也OO了。Python是多用途的(可用于桌面应用和web应用),PHP是专长于web应用的。当PHP还在苦恼如何整合进去大程序时,Python早就可与Java,。NET相连了。。。。
* Python的可读性,可维护性比PHP好; *
PHP的发展存在一个向后兼容性的问题,Python不存在; *
PHP的入门门槛底,Python比较高(其实Python语言是挺简单的,难在要有OO的思想,PHP在OO化后,面临同样的问题);
* 到目前为止,支持PHP的服务器多,支持Python的少
(随着硬件成本的降低,估计状况很快会改变)。曾经有人说过,PHP的底层架构不适合用OO,那Python为什么OO用的那么好?曾经有人说过,PHP用OO速度慢,那用Python的人,为什么并不觉得慢?PHP用OO个人觉得是件好事,但看过Python以后,感觉PHP现在实现OO的功能与方法比Python还多,是好还是坏?作为一种脚本语言是否能很好的承载得起呢?感觉PHP有点像当年的C++,既要面向OO,又要兼容C,搞得倍复杂。而Python有点像当年的Java,从开始就是面向OO的,并立足于脚本语言,对OO的功能与方法作了相当的简化,做自己力所能做的事情。PHP以简单易学而名,现在为了企业化应用,如果搞得像C++一样既要顾及兼容性,又几乎全盘copy
Java的OO功能,难免会变得复杂,之后会不会被其他语言所代替呢?他山之石,可以攻玉。我们是否应该学习一下Python,从中得到一些启发呢?现在当大家都一致看好PHP时,结合种种迹绍,我似乎感到了背后的一丝寒风,。。。希望只是己人忧天。从PHP发展的角度,为今之计,我想最好的办法,就是大力普及推广PHP在中国的应用,先占领市场再说,因此写了个建议
(连接),可惜看来也是胎死腹中了。。。==========================================================================第一部分:介绍PythonWhat
is Python?(PYTHON的中文解释 :)Python is a programming language that is
freely available and that makes solving a computer problem almost as
easy as writing out one”s thoughts about the solution. It can be
written once and run on almost any computer without needing to change
the program. In this section, you can learn more about what Python is,
how it is used, and how it compares to other programming languages. Use
the menu below to browse the various sections of this article.Python was
first created by Guido von Rossum in 1990 and was named after the
Brit-com Monty Python”s Flying Circus. It has since been developed by a
large team of volunteers and is freely available from the Python
Software Foundation. The most recent version of Python, 2.5, was
released in September, 2006.Python is now found in many incarnations. At
the website of the Python Software Foundation, Python is written in C.
Other incarnations exist. A Java-based version of Python exists in
Jython and may be used to work with Java c