11 skills for improving programs and 11 skills for improving programs
1. Try to keep the method as short as possible (5-20 rows, one screen can be placed)
2. Never use the same variable for multiple purposes
3. Use the self-described variable name and method name (the highest state code of the annotation is the annotation)
4. Define the variable as close as possible to use it.
5. Reject Mysterious Numbers
6. Treat your language with friendliness
7. Do not line against the regular
8. Be cautious about premature optimization
9. Actively rebuild tested programs
10. Do not over-indulge in skills
11. Learn new knowledge through examples
There are many reasons to explain why we should write clear and readable programs. The most important thing is that you only write the program once,
But it will be read countless times in the future. When you look back at your code the next day, you will begin to read it. When your code is sent to other
A person must read your code. So spend a little more time saving you a lot of time reading it.
(Excerpted from IT comments of external journals)