I just finished reading the book "pragmatic programmer. From journeyman to master" . I will not be alone when I say that every programmer should read this book. This post is a grouping of terms and principles, which for me personally was the most interesting science that comes from the reading. Most of them are familiar, but I think so important to once again be said of them, and underscore their importance. Moving along the vertical axis, the projection of current location on the horizontal axis does not change. That should be designed systems: changes in module A should not be seen by module B. Both modules need to communicate through well-defined interfaces and implementation details should be hidden so that each of the modules could be modified or even replaced without need for change in other modules.
Law of Demeter (the principle of minimum knowledge)
In a nutshell: you can talk only with the objects of their own environment. Do not pull out of these other sites ("Guts") to talk to them (this would be the penetration of the implementation). Let the parent object will delegate the call accordingly, deciding he wants to achieve a specified goal. Instead of:
car.getOnboardComputer (). GetGPS (). GetLocation ();write
car.getLocation ()leaving the Car class decide how to implement a determination of the location.
Missiles streak
authors called this technique is somewhat similar to the prototype, which recommends the creation at the beginning of a very poor solution, but going through all the layers and as a basis for further development of the system. Unlike the prototype, the solution is not going to trash after verifying that it works, but it becomes an integral part of the system, around which new functionalities are created until the completion of the project. Name tracers comes from the fact that the developed code can determine whether the project goes to the purpose "that goes in the right direction at the beginning, having implemented with only the smallest possible part of the functionality. Today in the era of agile , unless widely used technique;)
Reversibility Make decisions
reversible. Prepare yourself for the fact that the customer wishes to change the version, or even a database, application server, etc. ...
Programming accidental
Fred does not know why the program does not work, because they did not know why the program worked.
Meet API
and technologies you use, not to create a code at random, the code that works by accident .
Unit Testing is like testing integrated circuits - the signals are submitted to the relevant entry causes the corresponding states outputs.
DRY
On this principle I will not repeat:)
0 comments:
Post a Comment