"Pragmatic Programmer" book review (d)

  The main talk about reading the fourth chapter - "pragmatic paranoia" sentiment.

  "Design by Contract" is the first learning session, I was a student, but also have some understanding of the work, at least at least is aware of "contract" this thing. This blog entry talking about a "concept contract", focuses on the DBC. Although I do not really understand this design "model", but I learned a few things, such as the same item. In this one, the core idea of ​​what I need to practice, may be able to understand the two.

  We are in the process of writing code, often face a variety of bug, I, as a member of the white, but also a lot of errors occur, an error occurs while before I will have a "get called, so should not write go wrong, "the idea, after the fact gave me a slap. "Death does not lie," it is the second lecture content. Our most effective method is to reduce the probability of error checking and more, of course, to check with the naked eye is one way, but in that case I am afraid that most programmers have quit the strike, and this time we will learn to use exception handling mechanism, such mechanism often used in Java, but after all, the language is a tool, as a qualified programmer, can not say that another language would not handle the exception, right? Therefore, "when and how to use exception handling method", is essential.

  Is also a discussion of the situation which, if you do not want to let it happen, it is best to last "safety catch" that is talked about in the book, "asserts programming", but in time to avoid the use of such programming a Misconception: The test will be able to find the bug. Assertion-oriented programming is just that the situation "will not happen", There is no other use. But after considering memory problems, you may choose to "Off" out some programming, but this situation Be careful not to "OFF" key out of place.

  The final step is the allocation of resources. "As long as the programming, we have to manage resources: memory, transactions, threads, files, timer - a limited number of all things." So, of course, it is the focus of the allocation of resources to consider.

Guess you like

Origin www.cnblogs.com/20183711PYD/p/12121484.html