PHP veterans talk about the basic features of PHP and Python_PHP Tutorial

WBOY
Release: 2016-07-15 13:26:31
Original
1184 people have browsed it

The author of this article has been working in PHP for 11 years, but recently started to switch to the Python camp. The following will provide some descriptions of the respective features of PHP and Python, which may also be helpful for you to choose the appropriate language for your project.

Look at PHP and Python: Problems with PHP

The reason why I gave up PHP was first of all the language. PHP is actually not a language, but a huge plug-in structure that displays low-level libraries in a high-level form. The languages ​​used by most developers are actually wrappers for C functions (curl, mysql, gd, etc.), and usually their libraries are very simple. This leads to PHP’s API being inconsistent.

The second problem with the PHP language is language management. The PHP language was actually designed by a committee, and no one set any consensus standards . PEAR has its own standards, PHP has its own standards, which results in SPL classes being more Java-style, while PEAR is completely different.

In the 11 years since I have been engaged in PHP development, I have met many expert developers in the PHP field, and they also have many opinions on PHP. In addition to the committee issues and standards confusion mentioned above, due to the wide range of use of PHP, backward incompatibility has caused a lot of damage to the code.

Another point to mention is that PHP lacks many features of modern languages. Now let’s talk about Python:

PHP and Python: The beauty of Python

The way the Python language was created is almost the exact opposite of that of PHP. First of all, Python is led by Benevolent Dictator and Guido van Rossum, and the development of the language is led by a single person, so its development, management, and long-term operations will maintain good continuity. Guido and Python's core developers create standards through PEPs and demonstrate how standards are created through public interfaces. Moreover, if the language features Guido thinks of are not good enough, they will not appear in the language layer (for example, there is no ++ operator, and there is no assignment in the comparison operator).

The continuity feature also extends to the entire Python community, so it is difficult for you to find completely different Python in different projects.

One of my favorite features of Python is its clarity. When I open a file in Python, I will clearly know what kind of code is inside. Thinking of the many times I have been frustrated by this aspect of PHP, I think this feature is very useful.

In short, Python’s system-level features are very good.

Another great feature of Python is its straightforwardness. Need namespace? The name of the file is the namespace; need a module? Just use an __init__.py file instead; need to rename the function? Just need new_func = old_func.


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/446592.htmlTechArticleThe author of this article has been working in PHP for 11 years, but has recently begun to join the Python camp. The following will provide some descriptions of the respective features of PHP and Python, which may help you choose the right one for your project...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!