PHP can run in cli mode as well as many libraries and extensions. in the case of Web development, you can develop desktop applications with libraries such as gtk. Why does PHP not replace Python, their syntax is also simple and quick to get started, with development efficiency for running efficiency, many places are very similar, and now a variety of training institutions teach PHP more than Python, PHP is also widely used than Python. PHP can run in cli mode as well as many libraries and extensions. in the case of Web development, you can develop desktop applications with libraries such as gtk. Why does PHP not replace Python, their syntax is also simple and quick to get started, with development efficiency for running efficiency, many places are very similar, and now a variety of training institutions teach PHP more than Python, PHP is also widely used than Python. Reply content: I cannot see how similar they are.
Weak PHP type; strong Python type.
PHP main Web; Python main common.
PHP naming is messy in the early days, and features are not fully supported (Unicode, namespace); Python is much better than it.
PHP extensions are concentrated in Web development. Are there crawlers? Is there scientific computing? Is there big data? Even program-controlled systems do not work well.
PHP syntax is becoming more and more complex (adding features as C ++); Python is relatively clean.
PHP didn't even have a decent interactive shell (I found one, which was written in Python). Python not only supports interactive shell, there are various useful things such as ipython, bpython, and ptpython, as well as notebook based on data analysis.
I can't even translate SQL statements before PHP? When I first met Python, it was db api 2.0. it is used correctly and there is no need to worry about SQL injection.
PHP is a bunch of dollars. Python is more like plain text.
.......
PS: Why do I only talk about the shortcomings of PHP and the advantages of Python? The answer is "why does PHP not replace Python", not "Why does Python not replace PHP 」! Php never wanted to replace python. if so, most training institutions exaggerate php to fool you!
I used to try to use php to solve all problems, such as writing daemon, packaging desktop software, and writing cli tools. later I proved that it was futile and php was not suitable for doing this, rather than being unable to do it, they are all Turing equivalent languages, but other languages can do better.
When I use php to write daemon, it is easy to encounter a situation where the CPU will soar to 100%. Later I also encountered a daemon written in php, which also throws myself. The possible cause is the absence of timeout settings (stream_set_timeout), the absence of timely destruction of constantly expanding variables, and the absence of shutdown when a new database connection is opened.
Later, I no longer used php to write daemon, because the script feature of php is to automatically release all resources after each request is completed, so I will not consider resource release and timeout issues when writing, I am used to this method and cannot write daemon at all. it is not suitable for writing desktop software. Strictly speaking, this is not a problem of php, but php has spoiled you, abuse Resources without releasing them.
In addition, php has an ugly shell, such as php-a, which only needs to be echo every time and can directly run php code, for example: php-r 'echo time (); ',-r indicates run, and the code part does not need to be added. Although Python is bad
But to replace Guido with PHP, go to sleep. I want to say, are you stupid... Why are you inviting me? I don't know PHP.
My only understanding of PHP is the "best language", but I have heard that most of Python is about "suitable for beginners" and "suitable for mathematical research, first, the reputation goes up.
In addition, you can find pip so many underpants on PHP. most web websites use php.
Python is mainly used in command lines, so you can see that many O & M tools are written in Python. Things in the world are not alternative and compete with each other. various languages have their own advantages and irreplaceable values. php and JAVA can be combined to develop enterprise-level projects, so what is the reason to exclude the Python that runs like a command line? The right one is the best. It is like asking who to replace mall.
Instead of replacing others, there is a space for survival.
Php was once considered as a sunset language. Later, various frameworks became popular, which made the technical requirements for developing a product lower and lower.
In terms of community activity, there is no obvious strength between the two. Why didn't the pistol replace the rifle?
Different scenarios are different.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service