Project

General

Profile

Recommend coding style » History » Version 1

jun chen, 03/10/2025 12:18 AM

1 1 jun chen
# Recommend coding style
2
3
## Name style
4
5
* Class/Struct: Capitalized each class 1st letter
6
* variable: -nix style, all words are lower case and concat with '_'
7
* member variable: in C++, it is same as the variable but should be end with '_',
8
	in Python, it is the same as the general variable, refer to PFP8
9
* function: -nix style, same as the variable, refter to verb + capital
10
* member function: same as the general function
11
* macro: all works should be in capital
12
13
## Headers
14
15
* 1stly, put stl lib
16
* 2ndly, put 3rd party lib
17
* 3rdly, put internal lib
18
pl江 always use the same order for the same lib, gcc could optimize the compile time if the ord er is the same, for stl lib including, prefer include "std.h" instead.