Why didn't so many people make spams of PHP, and didn't say the reason why so many people make spams of PHP?
The problem has been disabled. cause:
Reply content:
Why are so many people talking about PHP?
Objective answer:
1. PHP language and environment, which is inferior to other mainstream languages and environments.
2. PHP has been brilliant in the history of Internet development. Web2.0 is basically its credit. In that age, PHP was the only thing that could make money. These are advantages.
Therefore, due to the fierce contradictions and advantages of PHP, there will be a huge controversy and topic. This is not the case for other languages because there is not such a fierce conflict.
I have been writing PHP for a long time before, but it is PHP black now. Let me briefly explain the reason.
-
Unreasonable syntax Design
It is true that there are historical reasons, but it is indeed unreasonable.
- Namespace (
\) Separated, it is simply mad; object members use (->) Access, slightly cumbersome
- Function names are case-insensitive, and class names in earlier versions are case-insensitive, while variable names are case-sensitive.
- Array syntax is cumbersome (
array()), Until 5.4 there is a short syntax ([])
- This way
function test_array(array $input_array)Can limit the type of parameters, applicable to classes and arrays, but notintAndstring
unset,echo,empty,listLooks like a function, but not a function.
- Not supported until 5.4
func()[0]This writing method
- Most internal functions do not throw exceptions by default, resulting in two sets of independent error handling mechanisms in PHP.
-
Many discarded features are still widely used, and new features are becoming increasingly popular.
This is a user thing, but this is the case.
It is more prominent in open-source software. For example, in order to be as compatible with the old PHP version as much as possible, WordPress cannot use anonymous functions (5.3) or array shorthand syntax (5.4) this function can greatly improve code readability.
Below are some discarded functions. Most of these functions are designed incorrectly and may be discarded due to potential problems. However, some unreliable tutorials are reproduced on the Internet, so many people are still using it.
__autoload
mysql_*Series Functions
- Register Globals
- Magic Quotes
- Safe Mode
-
A good package manager and dependency management solution are missing
PHP, Python, Ruby, and Node. js overlap in the field of use. Let's compare the number of packages:
- PHP Composer: 46 k
- Python PyPI: 53 k
- Ruby Gems: 94 k
- Node. js NPM: 116 k
Although the number of packages does not represent quality, it indicates whether people are willing to publish and use the packages.
The penetration rate of Composer in PHP may not be as high as the other three package managers above. For example, as the most popular blog program WordPress, and Typecho in China, Composer is not used, but all dependencies are directly included in the source code.
-
A separate process must be created for each request.
PHP must create a process (or thread) for each request, which occupies a large amount of memory in high concurrency.
It is difficult to create a resource in PHP and allow it to be accessed by all requests globally. It can only be implemented through external databases or caches. There is no way to define a task, which runs independently of other requests. It can only be solved through a separate task queue. Although these two problems are not serious, it is a shortcoming that we cannot maintain the global state in a lightweight manner.
-
PHP is a Web-optimized programming language.
- Can be used directly
$_GETAnd$_POSTAccess GET and POST data from the client
- Available
Embedded into HTML files.
Currently, most Web programs are usually in the MVC Architecture. In this architecture, PHP with extra syntactic sugar is not better than general programming languages.
On the contrary, although PHP can be used in non-Web scenarios, there are many pitfalls. For example, there is a lack of easy-to-use Asynchronous process control solutions.
A language in the dark can only show that this person has little knowledge, and the language is just a tool. It is suitable for different occasions and does not like it. You don't need to be qualified.
For example, some people say that php's shell function is weak, and php is designed for web development by nature. You need to use chopsticks as a fork and say that it is not easy to use.
For example, php performance is poor, but I don't know many websites written by beginners of. Net and Java, and a bunch of performance bugs are not the advantages of php design.
There are advantages and disadvantages. The key is how you use them. Black PHP people are probably wondering why big Internet companies in China use PHP
Php is easy to use.
He just wanted to show how good he was learning the language.
Black enough to appear high
Python c ++ has its own shortcomings.
If you know something about php, you should try again.
There is a saying that programmers should be responsible for their own behaviors, but few programmers actually do this. So c ++ c # java is a strong type language to constrain the behaviors of programmers.
Php obviously lacks these rules and there are some criticisms for the implementation of php's weak types.
I agree with my @ 2015_73720. I can't say that cell phones are easy to use without a single SLR camera. It means that cell phone design is unreasonable and people are not born to do this. It is enough to do their jobs well.
The speed of upgrading is doomed. A large number of users cannot be upgraded as PHP says, at least with the help of users. Microsoft is dedicated to promoting Windows updates. Isn't there many XP users?
PHP is one of the best languages in the world.
PHP is one of the best languages in the world.
PHP is one of the best languages in the world.
PHP is one of the best languages in the world.
Note that PHP is one of the best languages in the world.
PHP is one of the best languages in the world.
PHP is one of the best languages in the world.
PHP is one of the best languages in the world.
PHP is one of the best languages in the world.
PHP is one of the best languages in the world.
PHP is one of the best languages in the world.
PHP is one of the best languages in the world.
PHP is one of the best languages in the world.
PHP is one of the best languages in the world.
PHP is one of the best languages in the world.
PHP is one of the best languages in the world.
If PHP is not good, how can it be used by many companies?
PHP is not dead. You may not comment on this issue!
PHP is one of the best languages in the world.
Answers from zhihu
Great gods upstairs !!!
Self-righteous big brother...
If you don't understand it, you will be confused... Smile