20-character course of learning procedures

Source: Internet
Author: User
The 20-character principle of learning programs-general Linux technology-Linux programming and kernel information. The following is a detailed description. Small functions:
Try to get the common points of the function, with fewer lines of code. A function can only complete one simple function. At a glance, we can see whether the function has any code errors. Every function is robust, then your program is robust.

Less code:
When you complete a function, the fewer the code, the better. Do not write more than the code.

Better algorithms:
Efficiency should be taken into account when completing a function. At present, the computer memory is very large, so memory is no longer the primary consideration, but efficiency is very important in some special places. Efficient Algorithms do not need low-efficiency algorithms.

The name should be clear:
The name must be clear. It is best to use the so-called object structure in Chinese, such as set_buffsize ().

More files:
Try to divide a large program security function into multiple files. Do not create more than 1000 lines for a single file, so that you can clearly know that the file code is robust, the file may have potential risks. You can check several files in a targeted manner during code check.

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.