PHP与Python的比较 (PHP vs Python)

这篇博客探讨了PHP和Python两种编程语言的优缺点。PHP以其简单易学著称,但在面向对象编程方面可能变得复杂,而Python则以其良好的可读性和可维护性受到青睐,适合大型项目。尽管PHP在Web开发领域广泛使用,但Python的通用性、可读性和对象导向特性使其在某些方面更具优势。此外,文章提到了Python在服务器支持和社区资源上的不足,但也指出随着硬件成本下降,情况可能会改善。
摘要由CSDN通过智能技术生成



在这里,我节录了一些关于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在中国的应用,先占领市场再说,因此写了个建议 (连接),可惜看来也是胎死腹中了。。。

==========================================================================
第一部分:介绍Python
What is Python?

(PYTHON的中文解释 :http://www.okpython.com/bbs/thread-73-1-1.html)

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 code natively.

Iron Python, a C# version, exists for the .Net and Mono platforms and allows C# programmers access to Python's power and flexibility. In each of these instances, Python is written in one language and works natively with that language; however, it also interacts very well with other languages through its many modules. For purposes of research and development, there is also a Python implementation written in Python itself. The project PyPy was founded in 2003 in order to enable Python programmers to change the behaviour of the Python interpreter at will. While it is an open source project, being developed openly by a community of developers for free distribution and modification.
How Python is Used

Python is a general purpose programming language that is able to be used on any modern computer operating system. It may easily be used for processing text, numbers, images, scientific data, or anything else which one might save on a computer. It is used daily in the operations of the G
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值