Home >headlines >A brief discussion on the advantages and disadvantages of php

A brief discussion on the advantages and disadvantages of php

无忌哥哥
无忌哥哥Original
2018-06-27 16:02:5411771browse

1. Advantages: Open source, free and fast [fast program development, fast running, fast learning of the technology itself]

1) Cross-platform, superior performance, combined with Linux/Unix The performance is 45% better when combined with Windows, and it is very economical to combine with many free platforms, such as LAMP (Linux /Apache/Mysql/PHP) or FAMP (FreeBSD/Apache/Mysql/PHP), or the data application is large enough. Consider changing to PostgreSQL or Oracle, which supports N types of databases. (N >= 10)

2) The syntax is simple, if you have learned C and Perl, it is easy to get started, and it is partially similar to ASP. There are mature development tools, such as NuPHPed, or Zend Studio, etc., and you can use Eclipse and so on under the Linux platform.

3) Currently, mainstream technologies are supported, such as WebService, Ajax, XML, etc., which are sufficient for application.

4) There is relatively complete support, such as using ADODB or PEAR::DB as the database abstraction layer, using Smarty or smart template as the template layer. If it is PHP 5.1, you can also use PDO (PHP Data Object ) to access the database.

5) There are many mature frameworks, such as the framework that supports MVC: phpMVC, the framework that supports event-driven events like ASP.net: Prado, the framework that supports rapid development like Ruby On Rails: Cake, etc., Sufficient for your application needs.

6) PHP 5 already has a mature object-oriented system that can adapt to basic object-oriented requirements. Suitable for developing large-scale projects.

7) There is a mature community to support PHP development.

8) Currently, many large-scale applications use PHP, such as Taobao, Yahoo, 163, Sina and other large portals. Many use PHP as their development language, so large portals can choose it. I think it's enough for your use.

9) There are many open source frameworks or open source systems that can be used. For example, the well-known open source frameworks include Zend Framework, CakePHP, CodeIgniter, symfony, etc., open source forums include Discuz!, Phpwind, etc., and the open source blog WordPress, Open source online store systems such as Ecshop, ShopEx, etc., and open source SNS systems such as UCHome, ThinkSNS, etc.

10) Low cost of use (linux apache mysql php kernel)

2. Disadvantages,

1) Function naming is not standardized Camel case method and sliding Lines, parameter transfer positions are different, you know

2) Single thread; PHP itself, PHP has always been a single-process program; although PHP's pthreads extension has long been available. But it is not stable enough, and it will hang up inexplicably while running; PHP extensions are all written in C, which means that if any extension has thread competition resource control problems, the whole thing will hang up

3) The core asynchronous network is not supported (of course there is only a synchronous non-blocking network model in Linux). But the lack of this makes it difficult to develop a network application that can withstand large concurrency. Both traditional network models and io are blocking. The basic programming approach is that a process (or thread) responds to a user connection request. Therefore, it is impossible to complete tasks like real-time online games that require thousands of network connections. Although PHP also has Libevent and eio extensions, which can make up for this to some extent, they feel that they are not so perfect.

4) It only supports web development, and it is not convenient to make .exe files or desktop applications. It is not convenient to make mobile phone programs.

5) It is not suitable for crawlers, automatic running scripts, and scientific computing projects. The basic structure of this language is not suitable, although there are many ways to achieve it.

6) Difficulty in post-maintenance. The speed-up space in the later period is quite limited.

Quote from Brother Bird [Laruence]:

It’s bad to say that PHP does not support multi-threading (90% of these people don’t know that the multi-threading model and the IO reuse model are equivalent). Saying that PHP does not support asynchronous (90% of these people have no idea what asynchronous means), sucks. Saying that PHP is a language for losers (99% of these people just want to look for IQ superiority), sucks. Every time I see this I'm really helpless about the argument, because you can't make a person who is pretending to be stupid become smart.

Statement:
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