PHP programming mistakes

Source: Internet
Author: User
Tags php cli
Some misunderstandings about PHP programming and clarification are worth pondering, and some of them are a real catch. In any case, let's take a look at these misunderstandings. 1. PHP is an object-oriented language. some misunderstandings about PHP programming are worth pondering. In any case, let's take a look at these misunderstandings.
1. PHP is an object-oriented language, but not based on OOPS
This is completely incorrect understanding, especially for Java programmers who think that PHP is not based on OOPS; but they will find many object-oriented features, such as interfaces, methods, and abstract objects. To be honest, the initial version of PHP does not have many object-oriented functions, but PHP 5 adds many object-oriented technologies. More importantly, you may wonder why the Bootstrap code becomes so simple in PHP, thanks to the combination of PHP and OO.
2. PHP cannot implement specific functions
This misunderstanding sounds vague, but many developers believe that PHP cannot implement memory access and other functions. But the fact is that PHP is an extensible language. you only need to write an extension in C or C ++ for integration. Alternatively, you do not need to create one. There are already more than extensions available on the internet. you can use them as needed.
3. PHP Security
Since you think it is insecure, why not write secure code for it. I admit that PHP has a lot of insecure code, but as a programmer, we should try to write reliable and secure code.
If you compare PHP with. NET, PHP certainly fails. But if you are a skilled programmer, you don't need security "help ". Including daily security issues, but if their paths are dynamically generated, you have to be careful. Of course, if you are proficient in all commands, it may become safer.
4. not suitable for large applications
The reason why a language can be used to build a large and complex application is that it must have a certain degree of reliability and high performance, while the scalable PHP does not match. However, if the architecture of the application you designed and developed is very stable, what problems will happen to the performance and scalability of the application?
The fact is that some well-known websites are designed with PHP, such as Facebook, Wikipedia, and Yahoo! They can all work well.
5. PHP can only be used for Website Development
Indeed, it is common to use PHP for website development. However, the Command Line Interface (CLI: Command Line Interface) allows applications to run on non-Web servers.
Although some applications have high CPU requirements, PHP can still be used for development and operation by executing php cli. More importantly, if you want to use PHP to develop desktop applications, you only need to use Windows-specific extensions.
6. slow development process
I really don't know where it comes from. It is possible that the PHP code you write is messy and contains a large number of MySQL statements (although they are meaningful, they should not be put there ). In fact, PHP has a large number of frameworks for developers to use, and reasonable use of them will achieve twice the result with half the effort, greatly reducing the development time. Therefore, do not complain about slowness.
7. professional developers do not use PHP
There are various sayings about this misunderstanding. for example, PHP is a piece of cake for beginners, and it is prepared for those who do not want to take development seriously. Of course, I have to admit that PHP does not make any sense in some aspects, but it is really ridiculous to have such a misunderstanding. If many Web applications are developed using PHP, it would be totally wrong for developers who have always been rigorous to stay away from PHP.
8. performance problems
This is a technical issue, not a misunderstanding. Everything is good or bad. Performance Optimization has always been a topic for developers to discuss. In fact, applications with low performance may be filled with a large amount of junk code, such as implicit conversion, useless modules, and the lack of heavy loads in operation methods, which will affect the performance of PHP applications. But ultimately it depends on how you use this language to create a stable and fast application.
9. cheap applications mean low quality
Free and open source are the biggest advantages of PHP in the mainstream market environment. This means that most developers with professional knowledge can provide development services and save costs for customers. However, this does not mean that there is a problem with the quality, and high-performance applications can also be developed.
With the continuous development and growth of programming languages, various misunderstandings will come one after another, but in any case, some false rumors will not break through. As it is often said, practice is the only criterion for testing truth. Therefore, before choosing to believe or not to believe, it is best to test and confirm in person.

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.