mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20:18 +00:00
...
This commit is contained in:
parent
bb0bd293a0
commit
13ee2c3c04
@ -158,7 +158,7 @@ All kinds of contributions are welcome.
|
||||
- any suggestions
|
||||
- any questions
|
||||
|
||||
Check our [Coding Style Guide](https://pocketpy.dev/coding_style_guide/) if you want to contribute C++ code.
|
||||
If you find this project useful, consider star this repository (●'◡'●)
|
||||
|
||||
## Reference
|
||||
|
||||
|
@ -6,7 +6,14 @@ label: Coding style guide
|
||||
|
||||
# Coding Style Guide
|
||||
|
||||
## Naming rules
|
||||
|
||||
## For Python
|
||||
|
||||
Use [PEP-8](https://www.python.org/dev/peps/pep-0008/) as the coding style guide.
|
||||
|
||||
## For C++
|
||||
|
||||
### Naming rules
|
||||
|
||||
For class names, always use **PascalCase**
|
||||
|
||||
@ -53,7 +60,7 @@ For macros, use **SNAKE_CASE**
|
||||
#define TEST(x) x+1
|
||||
```
|
||||
|
||||
## Access control
|
||||
### Access control
|
||||
|
||||
Please use python style access control.
|
||||
|
||||
@ -74,7 +81,7 @@ public:
|
||||
|
||||
It does not forbid users to access internal members.
|
||||
|
||||
## Use compact style
|
||||
### Use compact style
|
||||
|
||||
Try to make the code compact if it does not affect readability.
|
||||
|
||||
@ -88,7 +95,7 @@ if(x == 1){
|
||||
}
|
||||
```
|
||||
|
||||
## For `std::shared_ptr<T>`
|
||||
### For `std::shared_ptr<T>`
|
||||
|
||||
Use a `_` suffix to indicate a type is a shared pointer.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user