The Pragmatic Programmer - book review expert to work from an early age 2

It took two weeks were read two chapters, in which these two chapters, was impressed about the bug read the terms of use of tracer bullets, building software prototypes, as well as for the shell to use programming.

    When you build something never constructed before, you try target shooting in the dark, because you've never done before, their needs ambiguous, you do not know, but you're not familiar with algorithms, technology, language , or library, you face a lot of the unknown, as well as time constraints, the work environment will change, the classical approach is the system will die before you finish the work, effort, however, results-oriented programmers will use tracer : the same tracer bullets and download environment, fly together under the same constraints goal, the Gunners can give timely feedback, write code efficiency can be greatly improved, tracer code portability and the purpose is to keep it, complete error checking, structure, documents, and self-examination, but is dysfunction, you can check how far away from the target, once you complete aiming to increase the function will become very easy. Also tracer code has many advantages, users can soon see something that works, developers can build a structure in which to work, with an integrated platform that can be used for things with the presentation, feel the progress of the work. But tracer Code may not be able to hit the target, but you need to constantly adjust the focus until the goal to complete the task, but even so also in the dark than you shoot a gun, much simpler, and better able to make you as soon as possible mission accomplished.

When we do not know how to do, or that there are many ways, and what method is used, the key is to enhance the efficiency, and we have to try each method once or make a prototype of each method it is clearly the latter method is more efficient. Software architecture that we can prototype testing, analysis, and then analyzed and then improved, which can greatly reduce your labor, if you have already completed the code but there is an error or not practical, does not meet the requirements, you have the idea, then to re-do, and so laborious and time-consuming, but also very small probability of success, not an immediate success, it would be better to do more than you can think of software prototype, so you can test multiple prototypes at the same time and then screened the best that most can achieve the purpose of a prototype, go to consider What if there is a lack of places to continue to change the prototype, so once, but the first method you know that if there is no complete implementation can be achieved, to constantly change in order to complete and achieve a lot of times, we can see, the establishment of efficient software prototypes. You can ignore the prototype of the correctness, completeness, robustness, style and so on.

I make good use of this book is to read shell programming, along the following lines, can be achieved by shell programming, to build complex macro commands ,, you complete a variety of activities commonly performed. Using the command shell strength, familiar shell , your productivity is rapidly increasing, spend more energy to the familiar shell , things will become clear up, multi-use shell commands. Then the teacher let us use cmd to run java decompile, in fact, only four steps, the first step, not across the disc, so to change the location of the disk, and then change the directory. The second step, execute javac * .java . The third step is the implementation of java source files. The fourth step is performed javap * .class file can then be called in order to get the whole process method, you can more clearly understand their own procedures, if it is someone else's program, you can also be analyzed by using the program to decompile the code own use.

Bug is something that a programmer must face in dealing with bug time, something is particularly important. Found bug after you should focus on correcting the problem rather than blame, bug is your fault or someone else's fault, and it does not matter, how should you should consider modifying the error, so as to solve the problem. Do not panic in the debugging process, the last to acceptance or submit when more can not panic if someone reminders next to your unfinished tasks but can not be nervous panic, so you can debug not come out, but to think about what caused the bug and commissioning of myopia is careful enough, only urgent modify bug desire, but the real problem of the code may be in the big front or behind the big, to think or consider to bug the root causes rather than bug concrete manifestation of me, which is equivalent to palliatives when sick, if you do not solve the problem on the source, there will be several surface problems, chances are you have a lot more ideas to solve a problem out, this is not the answer, so pay attention to the source of the problem, so as to the problem solve. In view bug before the first look at whether there is a warning, a synthetic test, not enough exercise application, you must be both tough test boundary conditions, test the reality of customer usage patterns, you need to conduct such a test system. Once you know what happened, you will find in addition to error. Make your data visualization, you can draw, this time the problem will show in front of you, inspect variables, we found this a bad time to look at other variables of variables, perhaps the problem will be solved. Do not assume, to prove, when you encounter bug when, first hypothesis to see what caused this bug, Consider whether you want to improve unit tests or other tests to give them the ability to identify the fault.

To be able to write code to write code, in a nutshell is what we see a carpenter making a repeat of things in life when they build ourselves fixture or template, once do these, they can quickly make the same things out and reduces the chance of error, as long as the first work is right there is no mold problem, the same we need to build a code generator, build good throughout the project life cycle and can use it no personal expense. The code generator is divided into active and passive, passive equivalent parameterized templates, and the initiative is a convenient means . Code generation may not be very complicated, and the code generator generate code does not have to.

To clear you can not write perfect software, No gold, no one is perfect, although it sounds hard to accept you, but you can turn it to advantage , encoded defensive for their mistakes, to ensure that identify the bug process, without causing any damage, so we try to check all kinds of things, and terminate the program when the program go wrong .

Guess you like

Origin www.cnblogs.com/tkg1314/p/11695316.html