Places that write procedures should pay attention to

xiaoxiao2021-03-06  113

Write a program should pay attention to:

1. For text editing box, it must be determined whether or not it contains illegal characters. For digital types, it is necessary to determine whether to contain non-numbers. For characters, it must be determined if it is within the allowed characters.

2. For a period of time, it must be determined whether the previous date is greater than a date later. Also judge the date of February. (The date of birth in www.chinaren.com has not judged). Don't tell me :)

3. For path selection, it is necessary to determine if the path is legal, whether it can be accessed. The input path length exceeds the maximum character length.

4. For the value to write into the database, it is necessary to determine if the length of the field definition is exceeded.

5. When writing data to a file to the network, it is necessary to be written.

6. For the default data in the interface, you must display the default value, even if it is 0, it should be displayed, because the software is not a person, the other people may not know.

7. When doing bulk deletion, it is best to provide a canceled button, so that others have a chance to regret.

8. When doing a long time, be sure to turn the mouse into a funnel type, let others know that your program is still running. It is best to display the progress with a progress bar. Give the user to continue the confidence.

9. For the menu item in the menu bar, it is best to make a shortcut on the toolbar, the user is very lazy, the Pakistan is not sitting there, keeps the keyboard and mouse, your program can work.

10. The folders and files in the operating system are not case sensitive, but the code written in the program is case sensitive. In particular, it is judged whether or not a file is present.

11. In an interface, the button in the functional set is as possible, don't go everywhere.

12. When you call the DLL in multi-thread, pay attention to the problem of concurrent access.

13. When writing data from the hard disk or database, it is best to write to the buffer, then write one time, so that speed can be accelerated.

14. When the parameter is named, try to make meaning, don't be a, b, b. . A function should not write too long, write more about it. You are gone, do something good for people come.

I hope that everyone will also write it to the place where you should pay attention to it, for a newblock.

转载请注明原文地址:https://www.9cbs.com/read-126142.html

New Post(0)