Generally, the following rules should be followed:
- Write the Comments First; Start your program with few words could help you be more clear about the problem, your algorithms and how to implement it.
- Document each variable; Put one-line words for each variable could clearly know what it does in that program at any time you need it.
- Use subroutines to avoid Redundant Code; Try your best to make each function independent with each other, which will be helpful for large program debugging.
- Make Debugging log; It would be useful to keep track of debugging. That saves your time for not debugging with same thing, also it could exclude the checked situations;
- Use Enumeration; Sometimes, it would be more clear for the programmer to enumerate every possible case rather than spend so much time on playing with logic.
No comments:
Post a Comment