First of all, I have learning Coding Rule of Alibaba Group, so I write this blog to learn it again.
1 Naming
-
Name in code can not be starting or ending with _ or $
:
name/ __name / $name / name / name$ / name__ -
Name must be in English
:
alibaba / google /apple
:
guge / pingguo -
Name of Class must use UpperCamelCase style except DO / BO / DTO /VO and so on.
:
UserDO / TcpUdpDeal
:
userDO / tcpudpdeala -
Name of function, parameter, class variable and local variable must use lowerCamelCase styple.
:
localValue -
Name of Const variables need to be writed as upperclass and words are spletted by “_”. You’d better let the name to be easy to understand and not to be too long.
:
MAX_STOCK_COUNT
:
MAX_COUNT -
Name of abstract class need to start with Abstract or Base; Name of exception class neet to be end with Exception; Name of test class need to be end with Test
:
MAX_STOCK_COUNT
:
MAX_COUNT -
Type and [] need to stay close to difine a array
:
int[] arrayDemo
:
int arrayDemop[]
近期评论