Joshua Kerievsky's book Refactoring Using Templates

    I read a subject book the other day. It was released back in 2008 (and the previous edition even earlier), but I only got it recently. In theory, it would be necessary to read it after Fowler’s book “Refactoring. Improving the existing code ”, to which Kirievsky constantly refers, but I haven’t reached Fowler yet, although it didn’t make reading very difficult. The second book, which is best read in advance, is “Object-Oriented Design Techniques. Design Patterns "gang of four.

    The essence of the book "Refactoring using templates" is that in the book the author has collected 27 rather complex refactoring, most of which are designed to introduce the patterns described in the book of gang four into the architecture of the program as painlessly as possible. As Kirievsky writes at the beginning, he often starts programming without using patterns until this section of code needs to be expanded, then it is taken for refactoring. True, there is one more refactoring in the book, which, on the contrary, eliminates the use of singletones (the author calls the disease when using singletones for any reason, singletonism and suggests opening a society of anonymous singletonics).

    After the first (and so far the only) reading, I was not particularly inspired by the idea of ​​the book, because many of the refactoring described are rather complicated (in the sense that you can’t automate them, I want to believe that for now), but stupidly repeating the described steps will not work, because each The code has its own characteristics. The main thing is to understand the general ideas of the individual steps of refactoring and, relying on them, to redo your code. Unfortunately, I realized this already towards the end of the book, so after some time I’m going to re-read the book again.

    During the course of reading, I often noticed that in the book I’m not even interested in refactoring, it’s interesting to just read about how other programmers build the architecture of programs - almost all refactoring examples are shown on code from real projects. At the same time, it is useful to read about errors in design.

    When describing refactoring, Kerievsky first uses UML diagrams to show what happened and what became, then he writes where this refactoring may be needed, what it can improve and what can worsen. After that, it describes the basic steps of refactoring and shows these very steps on the example of alteration of real code.

    All examples, like that of Fowler, are given in the Java language, but it does not use any features of the language, so the language is absolutely not important.

    I would not say that the book is easy to read, however, closer to the middle of the book my reading has accelerated noticeably, I don’t know what this is connected with. The book is very strange translated, and I don’t even know with a plus or minus sign. The fact is that many expressions were left without translation, including the names of refactoring. On the one hand, it’s good that you don’t have to rack your brains on the translation to guess which term the author had in mind, and on the other, the names of refactoring could be translated. It turns out that you read such an English-Russian text. Somewhere there were places when the term was quoted both in Russian and in English, why it was impossible to do so in the whole book is not clear.

    In general, the book is curious, you can read. Apparently, it should be considered as a continuation of Fowler’s book, but here I can be mistaken, because, as I said, I haven’t read Fowler’s book yet (I have it next in line).

    By the way, can you advise some more good design books? And at the same time, maybe someone has already read the book Effective Work with Inherited Code , is it worth undertaking?

    Also popular now: