PHP experts talk about the basic features of PHP and Python. The author of this article has been working on PHP for 11 years, but has recently started to invest in the Python camp. The following describes the features of the PHP and Python languages. maybe you have chosen the appropriate PHP for the project, however, I recently started to invest in the Python camp. The following describes the features of PHP and Python. it may be helpful to select a proper language for the project.
PHP and Python: PHP problems
The first reason I gave up PHP is the language. PHP actuallyNot a language, but a huge plug-in structureTo display the lower-layer databases in a high-level form. Most developers use the C function (curl, mysql, gd, etc.) packaging language. In general, their libraries are very simple to display. This causesInconsistent PHP APIs.
The second problem with PHP is language management. The PHP language is actually designed by the committee, andNo one sets any consensus standards. PEAR has its own standards and PHP has its own standards, which makes SPL classes more Java-style, but PEAR is quite different.
Over the past 11 years of development in PHP, I have known many expert developers in the PHP field. they also have many opinions on PHP. In addition to the committee issues and standard chaos mentioned above, PHP is widely used,Backward incompatibleIt causes great damage to the code.
It is also mentioned that PHP lacks many features of modern languages. Now let's talk about Python:
PHP and Python: The beauty of Python
The creation method of Python is almost the opposite of that of PHP. First, Python is led by Benevolent Dictator and Guido van Rosum. the language development is led by a single person. Therefore, its development, management, and long-term operations will maintain good continuity. Core developers of Guido and Python use PEP to create standards and use public interfaces to demonstrate how standards are created. In addition, Guido does not appear in the language layer if the expected language features are not good enough (for example, there is no ++ operator and the comparison operator is not allocated ).
The Continuity feature extends to the entire Python community, so it is hard to find that Python in different projects is completely different.
One feature of my favorite Python is its clarity. When opening a file in Python, I will clearly know what the code looks like, and think that I have been overwhelmed by PHP many times, I think this feature is very useful.
In short, Python has very good system-level features.
Another great feature of Python is straightforward. Need namespace (namespace )? The file name is the namespace. do you need a module? You only need to replace it with a _ init _. py file. do you need to rename the function? Only new_func = old_func is required.
Bytes. The following describes the features of PHP and Python. you may choose the right one for your project...