11 skills for improving programs and 11 skills for improving programs

Source: Internet
Author: User

11 skills for improving programs and 11 skills for improving programs

1. Try to keep the method as short as possible (5-20 rows, one screen can be placed)

2. Never use the same variable for multiple purposes

3. Use the self-described variable name and method name (the highest state code of the annotation is the annotation)

4. Define the variable as close as possible to use it.

5. Reject Mysterious Numbers

6. Treat your language with friendliness

7. Do not line against the regular

8. Be cautious about premature optimization

9. Actively rebuild tested programs

10. Do not over-indulge in skills

11. Learn new knowledge through examples

There are many reasons to explain why we should write clear and readable programs. The most important thing is that you only write the program once,

But it will be read countless times in the future. When you look back at your code the next day, you will begin to read it. When your code is sent to other

A person must read your code. So spend a little more time saving you a lot of time reading it.

(Excerpted from IT comments of external journals)

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.