Experience in developing large projects using PHP

Source: Internet
Author: User
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.
V. Database design
The database design is very important in the development of large-scale projects, and is related to the success or failure of the entire project development. I will not talk about it much more. You can gain experience in your own practice. In short, it is best to determine the database design at the beginning. Although the database structure has been designed can be changed during the development process, this will greatly reduce the development efficiency of the entire project, who is willing to change the database structure from time to time?
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.