世上规范千千万,遵循一种有秩序。
保持所有代码的一致性。使用相同的命名规则。这世界上没有最好的命名规范。
函数:动词+定语(形容词)+宾语(名词))
比如getResponse,sendRequest
成员变量:名词或者偏正短语(形容词+中心语(名词))
比如RequestHeaders,BufferSize
变量名缩写
count;index 代替num,no
total
application => app
average => avg
curren => cur
control => ctrl
config => conf
delete => del
document => doc
dialog => dlg
error => err
escpae => esc
length => len
message => msg
password => pwd
picture => pic
position => pos
print => prn
server => srv
string => str
source => src
temporary => temp
window => win