References
Naming
General Naming Rules
|
|
File Names
|
Type Names
|
Variable Names
|
Constant Names
|
Function Names
|
Macro Names
|
Formatting
- Line Length
- Each line of text in your code should be at most 80 characters long.
- Non-ASCII Characters
- Spaces vs. Tabs
- Indent 4 spaces at a time.
- Function Declarations and Definitions
- Return type on the same line as function name, parameters on the same line if they fit.
|
- Function Calls
- On one line if it fits; otherwise, wrap arguments at the parenthesis.
|
- Conditionals
|
- Loops and Switch Statements
|
- Pointer and Reference Expressions
|
- Boolean Expressions
|
Header Files
Classes
相关工具
CppCheck
AStyle
Artistic Style is a source code indenter, formatter, and beautifier for the C, C++, C# and Java programming languages.
- 网站:http://astyle.sourceforge.net
- 参数:--style=kr $(ItemPath) -s4 -A1 -j -U -H -p -k1