Code Art modification software

Source: Internet
Author: User
Mind Map click the picture to view the big picture

This section describes how to modify and add new features to existing projects, instead of developing new projects. So I will focus on software modification this time. Directory Index # Add new features, modify bugs; # Improve Design; # optimize resource usage; # consider the danger of adding new features. When fixing bugs, we can easily find out when maintaining existing systems. Products prefer to add behaviors, rather than changing or removing the behaviors on which they are originally dependent. . How do we determine whether to fix bugs or add new features? This is a question of angle, a question of competition between products and technicians. For example, the product wants to move the logo from the left to the right, and also to the right. From the product perspective, we can fix bugs and add new features from our perspective. The product never cares about the fact that we have to do some new work from the beginning. -- Differences in subjective opinions.
We must record and solve bugs and add new features separately at ordinary times, which facilitates our future maintenance. -- Generally, our company uses Jira for these records.

 

The purpose of improving the design is to change the structure and organization of existing software to make it easier to maintain. To improve the design, we have to propose refactoring. refactoring is a move to improve the design without changing the software behavior. We need to ensure that the structure changes do not affect the existing behavior, which usually requires writing tests. Code . -- Every small step carefully verifies that its behavior will not change.

The difference between optimization and reconstruction is different for different purposes. For refactoring, it is done for ease of maintenance Program Structure Adjustment. For optimization, it is to improve performance (such as time or memory ).

There are two words to consider: "Clean up" and "sort out ". Cleaning means clearing, while "sorting" does not. When restructuring or optimizing, we should pay attention to the differences between the two words. -- To communicate with others more accurately.

Dangerous changes are often accompanied by considerable risks when we need to make changes and maintain behavior. Method of thinking: When we modify the code, do you have the following questions in your mind. -- I hope you can ask yourself when modifying the code. 1. What changes should I make? 2. How can I determine that the modification has been completed correctly? 3. How do I know that it has not damaged any existing behavior? We often use traditional methods: When requirements come down, our first reaction is to add and modify existing classes or methods, rather than re-creating classes or methods. This is because it is less effort-consuming and safer. The consequence is that existing classes and methods are getting bigger and harder to understand. Moreover, we have to admit that we will become increasingly unfamiliar with the code, and we will change this place in the future, which will generate a sense of fear in our hearts. We will always fear that this place will be modified again, resulting in increasingly bad system structure. More advanced method 1. make modifications, make documents (mainly flowcharts), and comment out. -- I personally like to rewrite a method. My approach is to see if the class or method can be extracted and then rewrite the method. (1) I have a better understanding of the system. (2) enhanced my coding capability. 2. Hire more employees so that we have more time for system analysis and careful review of all code.

The above is a summary of the entire process of software modification. If you have any mistakes, you are welcome to make a decision.
Recommended references in "Art of code modification"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.