"The Pragmatic Programmer: from work to the experts," read two notes

  Chapter II: focus on pragmatic approach

  A. Repeat harm

  Repeat the procedure Hazard Identification define variables can not repeat, you have to make their own definition of variables unique and meaningful, this is a basic requirement, imposed on repeat, we can write a simple filter or code generator , a simple repetitive become, in the document you need to comment on the more advanced code, low-level code does not need comments, inadvertently repeated, then we want to distinguish clearly logically, those variables can be get through the first few variables, rather than requiring their own re-define a variable to complete this operation. In no patience repeat, we need to establish their own code base, method base, when such calls will not need to repeatedly copy the code and make changes before. In the repetition between developers, we need to encourage communication between developers, so as to effectively avoid.

  II. Orthogonality

  Some phase dependency is not orthogonal in computer technology or for decoupling, data and programs is the start of independent existence in the database, the program is not orthogonal to the maximum all the codes are placed the main program, and the teachers always stressed is sure to feature a modular, single, each method has only one function, the previous time I still do not understand, why write a code to invoke a variety of methods, led me to read the code is jumping around, it seems, really is their own ignorance, all the code together, so once something wrong somewhere, it is not easy to modify, the role is to facilitate the replacement of the module, the interface can be changed to correct the new module. Or on the module to make minor changes and modifications can be.

  III. Revocability

  When we make any decisions should be left to their own posterior approach, which is not preceded by a final variable into a final decision once we have attached conditions change, also can change our behavior, so that their losses to a minimum.

  IV. Tracer

  At the time he did not have problems solved, we need to use tracers to slowly close to the target, as I've written above APP function, like to use a Button to test, and then add a step by step after a successful test new features, and finally fully realized, then add to the work product. This is actually giving yourself a psychological suggestion, I slowly close to the correct result. The experiment code need not be entirely correct, his purpose is to let you modify and close properly.

Guess you like

Origin www.cnblogs.com/heiyang/p/10962273.html