Android Code Specification 05

Source: Internet
Author: User

Coding Logic Specification Summary:

1, avoid using multiple classes in a file, unless it is a one-time use of internal classes

2, one method code length best not more than 35 lines

3, in principle, try not to modify the automatically generated files, such as R file

4. Final string instead of direct "string", the same as int

5, not recommended in the loop, the direct return operation

6. Do not use goto statements

7, everywhere to consider anomalies

8, only for the need to publish the time to use public, other times with private or internal

9, try not to use public and protected programmer variables, using attributes to replace them

10, do not write the business code directly in the system automatically generated functions, it is best to customize the function, and then call

11, always use the interface, it is recommended to use the Display interface implementation

12. Always have default words in the switch statement to display the information

Directory specification, code naming specification, Coding logic Specification

Reference Sundy Teacher Tutorial

Android Code Specification 05

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.