个人使用的命名规范[适用]
文件夹(目录)和文件命名规范
Type | Format | Convention | Example |
---|---|---|---|
System | CapWords |
cap camel case | ProgramFiles |
Catagoly | CapWords |
cap camel case | MyGames |
Project | lower-with-hyphen |
spinal case | hexo-blog |
Normal | lower_with_under |
snake case | test_examples |
Files | lower_with_under_num.suffix |
snake case | my_file_01.txt |
Type | Public | Internal | Convention | Example |
---|---|---|---|---|
Packages | lower-with-hyphen |
spinal case | hexo-blog |
|
Modules | lower_with_under |
_lower_with_under |
snake case | phase_weighted_stacking |
Exceptions | CapWords |
cap camel case | MyException |
|
Classes | CapWords |
_CapWords |
capital camel case | MyClass |
Method Names | lowerAndCapWords() |
_lowerAndCapWords() |
lower camel case | myVariable |
Functions | lowerAndCapWords() |
_lowerAndCapWords() |
lower camel case | my_function |
Function/Method Parameters | lowerAndCapWords |
lower camel case | myPars |
|
Global/Class Constants | CAPS_WITH_UNDER |
_CAPS_WITH_UNDER |
full caps case | MY_CONSTANT |
Global/Class Variables | lowerAndCapWords |
_lower_with_under |
lower camel case | myVariable |
Instance Variables | lowerAndCapWords |
_lower_with_under |
lower camel case | myVariable |
Local Variables | lowerAndCapWords |
lower camel case | myVariable |
reference: https://github.com/naming-convention/naming-convention-guides