Naming Rules

    • Reduce code reading costs
    • Reduce maintenance difficulty
    • Reduce code complexity
    • Variable naming should try to describe its content, not type
    • Constant naming should try to describe its value, not how to use this value
    • When encountering for, if and other loops or branches, single letter names are recommended to identify parameters and return values
    • It is recommended to use words to name method, interface, type, and package
    • The package name is also part of the naming, please use it as much as possible
    • Use a consistent naming style
    • All lowercase
    • Avoid underscores (_) except for unit test
    • The file name should not be too long
    • Hump naming
    • See the name to know the meaning, avoid pinyin instead of English
    • It is not recommended including an underscore (_)
    • It is not recommended including numbers
    • Local variables
    • Function parameter output, input parameter
    • Camel case naming
    • The first letter of the exported must be capitalized
    • The first letter must be lowercase if it cannot be exported

    Reference