Don't let your code go crazy

Source: Internet
Author: User
  1. Why write this article?

    It is easy to write software now. To implement a function, Google searches, and SourceForge and codeproject add a bunch of open source code, you can change the logo to enter the army. Few people control the quality of software from the perspective of code. For example, some people mainly focus on software testing and pass as long as something meets the specifications. Some people control it from iso xxx, use the language of the moon to talk to Earth people. Some people mainly focus on food. As long as the coder is full, it is certainly okay to write things (I don't know if there is such a thing ).

    I wrote this article for two years and saw a lot of people and things struggling with messy code, building a pyramid on the ground that is about to collapse. There are too many temptations in this world. Many people just want to do it, not do it well. When QQ is used, it will definitely force you to know how to achieve the effect. You told him that you should do this, and thought about how to teach people to fish. The other party just did not accept the situation and seemed to have completed this function, in the future, I will go home to plant the land, and I will not need to write programs any more in my life. Code, piled up every day, like an abandoned spam, throwing UDP packets every day. This reminds me of the old saying that the Unix kernel has been changed to a mess after so many years of evolution. I think this is also true for a person or company. It is not a natural rule to organize the code and let the code grow freely.

    There is a suitable audience for any method. If you don't like the pleasure of coding and debugging with your own hands, you can look at the ideas in your mind as evidenced, I think the following suggestions are not suitable for you.

    This is the second revision of this article. The first statement is too emotional. In the future, we should learn the Lincoln method: a letter written when the mood is not right, and then resend it the next day. Xu Yibo will update this article as well as update the software.

  2. Write code carefully

    Every day, I write software into the code. No one knows the code better than you. However, if you do not carefully write or design the code before writing it, it is often difficult to control the entire situation at the end of the project. Smart C/C ++ programmers will never forget that the compiler is generating assembly code. When they need to surpass the ability of the language itself, they can still reach the specified region and control the generated code. (Extracted from the Internet)

    Those who have read the Windows source code must be envious of David Cutler's code, elegant style, clear procedures, and strict standards. It is difficult to reach this level without the accumulation and summarization of writing code over years.

    I have written almost 0.49 million lines of code since my sophomore year, including C, ASP, PHP, JavaScript, and ASM. No matter what language they are, I always try to write more comments as much as possible, and I am constantly improving the annotation specifications and auxiliary development tools (for example: txt2chm, msdn Lite version, extractor, Ed Editor, build, replacex ...), with the continuous development of technology, we are constantly improving various tools, and these tools are also better serving ourselves. When these forms a normal cycle, we can find that the world is harmonious and we don't need to be behind Microsoft's ass all day.

    Have you ever done this: After the code is completed and the test is passed, you will almost no longer read the code. When you find a better method (algorithm), will you modify the poor implementation of the Early writing. I never write comments. Even if I write, it is perfunctory.
  3. Assembly Line

    The assembly line makes a Ford car. In software, automatic building is another nickname of the assembly line. Automatically build the most important highly cohesive thing, and run the work of individual in the project team through tools to control trivial details as much as possible. As an item higher than a single project, automatic building can work together with products to expose product deficiencies.

  4. Modular and hierarchical

    The goal of modularity and hierarchy is to increase people's control. It is also a very successful management method. I think this is also a battle mode that Microsoft has thousands of software designers but has been using five or six small teams.

    When things are simple, you can think about what you want. modularity and hierarchy do not show its power. As things get more and more complex, you find that a lot of code is built up, interfaces are not uniform, names are not uniform, and file organizations are messy... what should you do at this time?

    I think when a system reaches the limit of chaos, what you need to do is not just jump in when your pants are too late to take off, devote yourself to the hot reforms (you often make things worse ). From the perspective of the onlookers, analyze the upper and lower layers of the system, and study the modularization and hierarchy of the system.

  5. Specifications

    Everyone has the habit of doing things. What a team needs is a common habit of doing things. Otherwise, a lot of time is wasted on communication.

  6. Use appropriate tools to do the right thing

    Try not to use a cow or a nail clippers. Every existing tool and language has its own needs. Before doing things, carefully analyze and investigate. The system considers various factors: portability, robustness, performance, upgrade, and performance. There are many variables in the world. Different tools can bring different effects in different environments and combinations. Sometimes, you really have to sigh that there is no definite answer in this world. Most of the situations you encounter are the first time in this world. If you do not have a thorough understanding of various tools, it is difficult to make a perfect answer.

  7. Continuous learning

    Whether you like it or not, the world has been turning and new things have been born. Good and bad things require you to make a choice, and your choice will have a huge impact in the future.

  8. Healthy

    Everyone knows that it is very important, but it is much harder to say than to do it. In addition, I often remind myself to brush my teeth every night after a toothache.

    Have you ever done this: work-not-live (from the Rhett blog), eat a meal a day, eat 3 meals a meal
  9. This article from: Xu Yibo http://www.xuyibo.org/article/44.htm
Related Article

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.