Names rules 命名原则
Choose descriptive and unambiguous names.
Make meaningful distinction.
Use pronounceable names.
Use searchable names.
Replace magic numbers with named constants.
Avoid encodings. Don't append prefixes or type information.
选择无歧义的描述性名字。
名字要能从意义进行区分。
使用可以读出来的名字。
使用便于搜索的名字。
使用常量代替魔术数(代码中的数字)。
避免对名字进行编码。不要添加类型前缀(即所谓的匈牙利命名)。
Last updated
Was this helpful?