-
Notifications
You must be signed in to change notification settings - Fork 0
Coding Guidelines
Aditya Gaddam edited this page Dec 18, 2020
·
1 revision
This is a loose set of guidelines for code.
KABUKI isn't meant to be the next unreal or unity. As such, keep features to sensible defaults instead of polluting the code with massively expansive options to try and handle every situation.
- Classes, methods, variables etc. should be all lowercase with words separated with underscores.
- Private member variables have a leading underscore.
Example:
class window : public engine_component
SDL_Window *_sdl_window;
- Always use braces. Even one line if statements.
- Braces should have their own line, unless it's a simple one liner.
Example:
if(width == 0 && height == 0)
{
width = dm.w;
height = dm.h;
}
or
bool is_running() { return _is_running; }
Prefer the use of smart pointers as much as possible. Specifically, try to generate and use std::unique_ptr
when possible.