Skip to content

Coding Style

Florian Preinfalk edited this page Jul 21, 2016 · 2 revisions

In order to keep our sanity while working on the engine, a coding style has been decided upon for ease of read and productivity. Examples have been put below, but for anyone who is used to

Bracing

Braces are always on the same line (K&R)

Types

Use the defined types in MAE/Core/Types.h, it helps things keep consistent.

Global Variables and Member Variables

Prefix your variables with g_ for global, and m_ for member if it’s not temporary.

Functions

Don’t do single line function declarations. Code should always follow on the line below.

Naming

Names should be short and simple. For Classes, Structures and Enums use UpperCamelCase. For Variables and Methods use lowerCamelCase. Macros are all upper case seperated by underscores.

Indentation

Some say spaces are the only true indentation style others say tabs. We are hipsters. We use both. e.g.

<tab><tab>auto test    = SomeValue;
<tab><tab>auto testFoo = SomeValue2;

Clone this wiki locally