Write code to be flexible

  Today in doing the project code, there are many places where it is needed after the attention, mainly to write code too rigid, not flexible.

  1, first-time statistical data, the original reference code has more statistical platform, requiring repeated four times, four statistical data, but the demand is, regardless of platform, so it stands to reason that this cycle can be to remove , but the reference code or write cycle four parts by four data, time-consuming and increases the data useless. So later when the reference code, be sure to check this code is in line with current demand, unsatisfied need to be removed or modified.

  2, followed by doing the right management this one, I had the idea is to first find out the next person to see all the members of the department, then in circulation in the statistical data to determine whether the sale inside. But if this process is time-consuming, in fact, the statistics department already have the information, it is only necessary to determine the next key name on it. After the data block to be applied flexibly, can try not to repeat the cycle, do not circulating

Guess you like

Origin www.cnblogs.com/xingyuecanxue/p/12141901.html