Experience in developing large projects in PHP: php development projects

Source: Internet
Author: User

Experience in developing large projects in PHP: php development projects

 

I. Variables
It is best to store all the variables in an array, which brings a lot of convenience in program development, especially when the program is very large. The naming of variables should be suitable for your habits. Whether it is in pinyin or English, it should at least have a certain meaning, so as to be suitable for memory. The variable name should be normalized as much as possible and should not conflict with the keyword in PHP.

Ii. Functions
PHP comes with many functions, which makes programming much easier. Of course, in large programs, we often need to define many functions, dozens or even hundreds. Of course, if you do not call a function in a program that uses the class, you should call a method. The usage of the class is not discussed here. When there are more functions, it is inevitable that they will be mixed up. Is there any way to solve this problem? The usage of the above variables is the same. Similarly, we can also put all our own function names in an array. In this way, we can check whether the function has repeated definitions at any time in the array. If you find that the phenomenon is repeated, you can change it immediately. This increases the programming speed. When using a function, you need to pay attention to global variables. Although this is a small problem, it cannot be ignored. Otherwise, when a variable calls a thousand calls, hehe. Check whether the variable has been declared as a global variable in the function.

3. Program comments
Program annotations are very important. Whether it is C or JAVA, program annotations can often reflect the good programming style of programmers. Whether it is for people or themselves, it is of great benefit. Of course, we are talking about the development of large projects. The spirit of group cooperation is very important. When your program is written, it is hard for others to understand how to talk about the spirit of group cooperation. Of course, if this large project is developed by you alone, it should be another matter, or you have a short time to write comments. But in general, this situation is rare. Unless it is a very time. A good programmer will definitely add comments to every program he writes, even for himself.

4. What text editing software is used to write source programs?
In fact, there is no certain rule, as long as you like it. I prefer PHPEDIT. Maybe I am used to it. Now I don't feel it when I leave PHPEDIT and write PHP. I use NOTEPAD when I am a beginner, because the program is relatively simple. So you can use NOTEPAD to cope with it. For programs with hundreds of lines, it is obviously inappropriate to use NOTEPAD. Using PHPEDIT improves productivity several times, even if you have never used it.

Http://php.662p.com/thread-277-1-1.html


Can php develop large projects?

Of course. Facebook is built on php, and of course it achieves some performance improvement expansion.

Google also has php code

What framework is better for php to develop large projects?

Yii is good, tp. Suitable for beginners,

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.