With a good development method, we can improve development efficiency, avoid and reduce error probability, ensure code quality, improve system maintainability, and avoid disaster incidents, you can spend more time looking for cool places to cool. 1. coding specifications improve program reliability, readability, modifyability, maintainability, consistency, ensure program code quality, inherit soft
With a good development method, we can improve development efficiency, avoid and reduce error probability, ensure code quality, improve system maintainability, and avoid disaster incidents, you can spend more time looking for cool places to cool. 1. coding specifications improve program reliability, readability, modifyability, maintainability, consistency, ensure program code quality, inherit soft
With a good development method, we can improve development efficiency, avoid and reduce error probability, ensure code quality, improve system maintainability, and avoid disaster incidents, you can spend more time looking for cool places to cool.
1. coding specifications
Improve program reliability, readability, modification, maintainability, consistency, ensure the quality of program code, inherit the results of software development, make full use of resources. The program can be inherited so that the work results of developers can be shared.
2. document comments
Add document comments before classes and Methods. When we call classes and methods using ide, ide will provide us with instructions for document comments, it is easier to avoid incorrect use of classes and methods.
Maintenance personnel can understand the role of classes and methods through document annotations, and truly achieve code is the role of the document.
We can also use phpdocument tools to generate documents from the documentation comments in the Code. by reading the documentation, the team can learn more about the project architecture and details.
3. Unit Test
Code farming stays up late. After writing a lot of code, it will get tired. When it gets tired, it is easy to make mistakes. How can we ensure that our error code is not hidden in the system, and the accumulation will lead to a disaster? Use unit test!
Code farmers often use group code. The class B written by Xiao A is not completely familiar with it. If you are not careful with it, you will use it. What should you do? Use unit test !.
Unit testing ensures code quality.
4. Version Control
The demand is always changing, and the code always needs to be changed. After a new appearance is changed, the boss says it's better yesterday. Did you back up the one yesterday? I forgot to back up the data and changed it to today's. What should I do?
Version Control Software can solve the problem. With version control software, it is easy to restore the code to previous submitted versions without worrying about code loss.
Mainstream version control software include svn, git, and Visual SourceSafe.
Git: if you are a large team and the code is updated frequently, some Members cannot connect to the version management server on the Intranet. git provides the distributed version management function, can perfectly solve your needs.
Svn: the old version management software is stable and reliable. The Sina cloud platform uses svn for app code maintenance. We use the svn client to submit code to the Sina cloud platform. Google cloud platform supports svn and git. Github.com also supports svn and git.
5. Project Management
If there are many team members, document management, task release, progress management, and so on, you need to manage the project management system tools.
If a small team of several people is not familiar with the project management software, at least a todo list (task list) should be written to clearly understand how to do things during Shenma, so as to estimate the development time, ensure that the project progress is controllable.
If you just talk about what you want to do, what functions you need, and whether you have a clear purpose, the progress is not only easy to drag, but also easier to isolate.
After the project is launched, it is best to have a bug management system.
6. Use IDE
A good development tool can get twice the result with half the effort.
Zend studio provides error prompts, code highlighting, code completion, and single-step debugging. It also integrates the svn/git client and PHPUnit testing.
If we leave the ide, we will suffer a lot in our days, and there will be more code hidden errors and lower efficiency.
If you say you like editplus and zend studio is too big to run on a computer, upgrade your hardware. What's the time, 2 GB memory should be there, or else it should be switched.
7. Use object-oriented
OOP has achieved three main objectives of Software Engineering: reusability, flexibility, and scalability.
A core aspect of object-oriented and process-oriented systems is how to assign responsibilities.
A procedural method is the continuous call of a series of commands and functions, and dependencies run through the entire project;
Object-oriented is assigned to specialized objects to minimize dependencies and improve software reusability, flexibility, maintainability, and scalability.
8. Layered Architecture
At least our applications must be developed using mvc. The Model-View-Controller is responsible for different responsibilities, which is conducive to the maintainability and scalability of the system.
If your system's business logic is complex, you can divide the model into the business logic layer and the data access layer to clearly allocate responsibilities.
9. Keep it simple
Simplicity is not simple, but simple and elegant.
Simplicity is the basis for reusability, scalability, and testability.
10. Message Communication, interface, and UI Standardization
It is easier to develop and maintain unified and standardized things and avoid unexpected errors.
Original article address: Improves the PHP development mode. Thanks to the original author for sharing.