Suppose we write some core business processing intoProgramFixed conditions are used as the basis for business processing, So we write fixed parameters and call them in many places.
Of course, at the beginning, the program won't have too many problems.
1. When new business needs emerge, we need to add new conditions as the basis for judgment. What should we do and add a fixed parameter ??
However, some businesses do not need this new condition as the judgment basis. What should we do?
Solution:
1. Add a * nopass parameter to the entry parameter.
2. Use Pointer as entry parameter ~~
In this way, you only need to modify the core program, and then modify the program that requires this condition as the basis for business judgment. If you do not need to use it, you naturally do not need to re-compile it.
2. What should I do when new businesses emerge?
In the past, our program had no parameters. How can we be called without affecting the original menu call?
So entry parameter list, we use the optional parameter * nopass