-
-
Notifications
You must be signed in to change notification settings - Fork 43
Contributing
Valtteri Koskivuori edited this page Jan 26, 2022
·
5 revisions
There is a very good chance you know way more than I do.
Please, shoot me an email at vkoskiv at g m a i l dotcom
Or submit an issue detailing your proposal. I'm more than happy to accept contributions to this project!
Just a few things to keep in mind before you contribute:
- Please respect the existing coding style and conventions, and avoid deviating from them.
- Ask before adding additional libraries/dependencies. I'm trying to keep this pretty lean in that regard
- Try and divide your contributions into discrete commits that each roughly perform one complete task/change.
You can see most of what you need to know by reading the code, but here's a synopsis. Code should be:
- Tab-indented
- Opening braces ({) open on the same line, not the next.
- function and variable names are
snake_case
(Used to be camelCase, transitioning towards snake_case) - Function and type names should be descriptive first, even if that comes at the cost of some extra typing. I.e.
struct vector
, notvec3
. See this for why. - Avoid obtuse one-liners in favour of clear, descriptive code. Simple ternary operations don't count, but don't nest them too much.
- Comments should usually explain the "why", not the "how". Exceptions should be made for math-heavy code where it may not be immediately obvious what the equation is supposed to be without operator overloading.
- pointer star hugs the variable name, i.e.
char *foo
, notchar* foo
- For everything else, see the existing code for reference.
You can also directly ping me on my discord vkoskiv#3100