Thoughts on code Maintenance

Source: Internet
Author: User

I took over a new job, mainly to maintain an old system (written in and years, with a history of 6 or 7 years). In addition, I wrote it using C ++ builder, I have been using vs for C # development before. I am not familiar with this IDE and feel a headache. ViewCodeAfter three weeks, I would like to express my feelings about the problems found during the code maintenance process.

1. No relevant design documents

There is no complete instruction or design document for a system with a large amount of code. The system architecture should be traced from running code and functions. As a mature software, the design instruction document should not be missing, or it is quite difficult to maintain it later.

2. Invalid naming rules

What makes me think incredible is that the variable name in it is just like the name of the software developer is a student at school (just like software programming). The variable name in it does not reflect any relevance, button1, button2 ..... the name of the buttonn ). A good software is specific to the naming of each variable. It is hard to imagine that such software has not been modified for several years in a listed company. Later maintenance personnel were on the default page to tolerate previous errors.


For example, when a large number of independent if statements are used to judge whether an int variable ranges from 0 to 4, five if statements are used instead of the switch statement, this is also confusing.

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: 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.