The way of code cleanliness

Source: Internet
Author: User

Care about the code. Eliminate repetitive code and increase expressive power.

You must always keep your code clean.

1, meaningful naming. To give a good name to a variable, you should learn English well. It is difficult to do two names without English skills.

Single-letter names are used only for local variables in short methods. The length of the name should correspond to its scope size. If a variable or constant may be used in multiple places in your code,

It should be given a name that makes it easy to search.

Rules for functions: short and short.

The function should do only one thing.

Each function is an abstract level. --Hard!!

Create a function that describes the same thing as the annotation.

Read the code neat way to really understand the importance of learning English.

The way of code cleanliness

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.