11 suggestions for improving the programmer's project design level and 11 suggestions for programmers
1. Analyze the project you are facing.
This is the first step in all work. If you make mistakes in this place, all subsequent efforts will be in vain. For example, if you want to complete the book management system, you should understand that this system is mainly used to solve the problems of book management.
2. Consider the project design method.
At this stage, you need to consider the design tools and languages based on the characteristics of the project. For example, the book management system needs to be encapsulated, which is conducive to management and maintenance. This system has a short development cycle and has simple functions. Therefore, choosing Java as the development language is a good choice based on its characteristics.
3. Collect complete requirements.
Spend time figuring out what are the basic needs of your user group and what are the final features of your product. Clear thinking can save you a lot of time.
4. Prepare a comprehensive implementation plan (or model ).
For small independent projects, this may be just a basic flowchart or a simple function model.
For a large project, it helps to break down the work into modules and take the following into consideration:
* What are the functions of each module?
* How to transmit data between modules
* How can each module call the data?
Although it is boring to collect requirements and write plans than to write code, it is even less fun to debug bugs than to spend a few hours. However, taking the time to pre-plan the correct process and structure of the program ensures the efficiency of subsequent programming.
5. Add comments to the code.
Add comments where you think you need to explain the code. The most common comments appear in function descriptions, variable declarations, and return values. They tell people what is useful and why this is done.
6. Use unified naming rules to name variables.
It will help you track every type of variables and figure out what each variable represents. Compared with the simple x = a + B * c, the variables named by naming rules can make the code easier to maintain and debug. The most common naming rule is the Hungarian naming method. The prefix of a variable name contains its function type. For example, the intRowCounter named for the integer variable and the strUserName named for the string type. No matter what naming rules you use, you must ensure the consistency of naming rules, and the rules can be simple descriptive of your variables.
7. Organize and edit the code.
Use a visualized structure to present the code structure. For example, code indentation is performed in the code blocks of conditional statements (if, else) or cyclic statements (for, while. For example, add spaces between variables and operators. This makes the code more intuitive and elegant, and the program process is clear at a glance.
8. Conduct a comprehensive test.
First, test common data values in each module to see if they are the same as expected. Then, test unconventional data types to eliminate hidden errors. Testing is an art. You can enrich your skills and insights in practice. The written test cases generally include the following situations:
Extreme Value: contains the minimum value and the maximum value that exceeds expectation, the text value of the null string, and the case where each parameter is null.
Meaningless value: assume that the user will input Something unrelated to the output requirement and check whether the program will respond to this.
Incorrect value: for example, if zero is used as the divisor, negative is used as the square root, or a number is input when a string is input.
9. Practice, practice, and practice.
The work of programming keeps pace with the times. You can learn a lot of new knowledge in practice, and the old knowledge you have learned before can be reviewed again.
10. Reduce the Risk of demand changes.
In a real working environment, changing requirements has always been a headache but a headache. However, if you can clearly present your needs and project plans at the beginning of the project, in the future, the design results and requirements may be deviated due to misunderstanding or lack of understanding. Therefore, in the project design phase, Please clearly present your requirement documents and work instructions before writing code: what the system needs, what you are planning to do, what is the progress of the work.
11. Learn from simplicity to complexity.
If you need to program something very complicated, this will help you do your work more smoothly. For example, if there is a project with any shape in the window, you need to design a program to change its shape based on the direction and speed of moving the mouse.
First, you can design a square that slides while holding the mouse to produce deformation. In other words, this step mainly solves the problem of mouse motion tracking.
Then, associate the size of the square with the speed of the mouse. In other words, this step solves the problem of association between the mouse speed and its own shape.
Finally, create the actual shape you want and connect the three components.
This method is helpful for coding modular projects, where each component has its own independent block. This is very useful for code reuse (for example, you want to use the mouse to track new projects) and make the program easier to debug and maintain.
How can programmers improve their abilities and make a project independently?
You can switch to a small company to improve your development level.
Then, join other colleagues interested in entrepreneurship to start a business, minimize risks, solve problems, and wait for several projects to have experience and work independently.
Join QQ, learn together, and start a business together. 1151860914
Programming projects for novice programmers
Different companies have different requirements.
Large mature companies may only need to write some small Functions Based on Pseudo code.
Most companies cannot have a large number of people. In many cases, a project is completed by several people. This requires a lot of knowledge and capabilities.
The suggestion is to lay a good foundation, do more things, and accumulate experience.
Xie yingmin [authoritative expert]