godotengine / godot-docs

Godot Engine official documentation
https://docs.godotengine.org
Other
3.95k stars 3.22k forks source link

Document C++ code style and naming conventions #4685

Open Xrayez opened 3 years ago

Xrayez commented 3 years ago

Your Godot version: Any.

Issue description: There's little information regarding existing code style used throughout Godot's C++ codebase in the docs, unlike GDScript and C#. This is important to document to ensure Godot follows consistent code style, and especially important for new contributors.

See godotengine/godot#33027 for consensus regarding C++ code style in Godot. To summarize:

Formatting

Code style

URL to the documentation page (if already existing): Can be added to the "Code style guidelines" page.

romlok commented 1 year ago

It should also be noted that m_ is seemingly the preferred prefix for macro parameters. p_ and r_ are mentioned in the docs (though not in the coding style doc), but searching for m_ comes up blank.