doc: Coding style additions
This commit is contained in:
parent
258ac4ea4c
commit
654802cc0d
@ -4,7 +4,8 @@ Coding style
|
|||||||
------------
|
------------
|
||||||
Look at the code. It is perfect and will be kept perfect. Requests to fix coding
|
Look at the code. It is perfect and will be kept perfect. Requests to fix coding
|
||||||
style are not to be taken personally by the one requesting, nor the one being
|
style are not to be taken personally by the one requesting, nor the one being
|
||||||
requested to fix his style.
|
requested to fix his style. If something is found to be missing from this
|
||||||
|
document, such additions shall be made.
|
||||||
|
|
||||||
The script (requires an unix shell and astyle):
|
The script (requires an unix shell and astyle):
|
||||||
Always run util/codestyle.sh before committing. It handles most whitespace
|
Always run util/codestyle.sh before committing. It handles most whitespace
|
||||||
@ -18,6 +19,13 @@ Identifiers:
|
|||||||
|
|
||||||
Never use "class", always use "struct".
|
Never use "class", always use "struct".
|
||||||
|
|
||||||
|
Prefer lightweight interfaces with a creation function for the default
|
||||||
|
implementation, like "struct State" and "State* createState()". The default
|
||||||
|
implementation can be called "CState" in this case, if an obviously better name
|
||||||
|
does not exist.
|
||||||
|
|
||||||
|
Use std::unique_ptr and std::shared_ptr. (core/types.h: up_<> and sp_<>)
|
||||||
|
|
||||||
Non-exception throwing and exception-throwing methods
|
Non-exception throwing and exception-throwing methods
|
||||||
-----------------------------------------------------
|
-----------------------------------------------------
|
||||||
- get_x: Returns NULL or equivalent if not found
|
- get_x: Returns NULL or equivalent if not found
|
||||||
|
Loading…
x
Reference in New Issue
Block a user