Programmers nine reconstruction ladder

"Java programmer"
to develop a project system and subsequent maintenance of a system, both the demand for the ability to require the programmer is completely different.

The new development project on the basis of the requirements is in line with the needs of programmers, meet the technical specifications.

While maintaining a long-term system, the internal code is often incomplete, clutter, many times programmers often need to understand the structure of the program from the code, understand its logic, before you can modify the update.

Therefore, we can be divided into nine levels in accordance with the ability of programmers refactoring code. This article will talk about the code refactoring seventh heaven.

First, read the code, in accordance with the needs rewriting

If the requirements and procedures to achieve inconsistent, then it is only in line with needs.

Although this is a reconstruction of the lowest level, but on the development of programmers, programmers are also moderate, because many programmers can not be realized in accordance with the requirements document needs properly.

Second, the demand can be understood that the control code according to the needs of the rewriting appreciated

And the first layer is similar, but in the control needs to understand the code at the same time, be able to dig out a lot of the requirements document did not write, but the code has been achieved needs.

At this time a certain ability to understand the insight.

Third, the control can be combed demand code rewriting on demand combed

Different understanding and combing, understanding is seen a block of code to understand the code, but it is sort of on the basis of understanding, but also abstract structure of the code has been implemented, although this abstraction is embodied in the code, but there is no clear written, and scattered in many places, programmers need to organize a collection.

That is, after comprehend the various codes, you can own the independent abstraction brings together a blend.

The first three levels are rewritten, is the need to re-complete existing work, you need to invest a considerable amount of work the same.

Fourth, when the original code has a certain quality, be able to read the code structure can be increased in accordance with the original small-scale structure of the code

This requirement is legacy code inside a certain quality, if the original code quality is poor, it is still rewrite it.

There is also a fourth layer of meaning, that is, the level of the programmer, work can continue to accumulate, without compromising the quality of the code.

Fifth, when the original code has a certain quality, and the code structure can read the code involved, modifications can be made small in accordance with the original code structure

Various additions and modifications, additional increases are logical, does not affect the original logic, to modify the existing logic may affect, in particular, there is an implicit dependence of time between the original logic.

The premise is to modify the original code has a certain quality, but also to modify the code has been no less than this level programmers, so that work can be accumulated, and will not reduce the quality of the code.

Sixth, when the original code has a certain quality, be able to read the code structure, you can modify the code in accordance with the original structure of the code structure

Modify the code structure may be a lot of people feel that this situation is rare, in fact, the most common is the upgrade framework, upgrading third-party libraries and other code base.

Often neglected in practical projects, and even some companies will arrange for a novice to do it, because I think what the new requirements are not met, does not create value.

For mature framework, third-party libraries, because there are already a large number of upgrade practice found various defects, but for immature third-party libraries and frameworks for, especially internal proprietary frameworks and libraries, not after upgrade compatible with the original logic even chaotic situation is very common. This time can not rewrite the entire project, you need to have a programmer the ability to upgrade in the quality assurance program structure.

And two in front of the same, similar work needs to have the same ability of programmers to ensure code quality, some companies often novice reconstruction, then blew let skilled patch.

Seven, when a clear and robust when the original structure, the original structure can be extended

This occurred mainly in the integration time, the structure of several programs are clearly strong, but also need someone to integrate the two, of course, to the reconstruction work at this level is no longer a programmer's specific needs, and but after the extended structure allows other programmers to continue in accordance with the extended structure developed.

Eight, when a clear and robust when the original structure, the original structure can be adjusted

This occurred mainly in the infrastructure changes, but do not want to rewrite business code, you need to be in the middle of the structural level adjustments, such as stand-alone deployment becomes a cluster deployment, you need to adjust the structure, making the adjustment process is transparent to the business code. Of course, this does not mean that is the best, but also need to follow the new structure of the tuning business in accordance with the code.

Nine, clear and robust when the original structure to time, be able to reconstruct the original structure

This large level of God in the world I do not understand

but

There can not deny the existence of such unimaginable programmer.

Guess you like

Origin blog.51cto.com/14512197/2443367