MeshLib
 
Loading...
Searching...
No Matches
Coding style

Tabs vs Spaces

Indentation must be made with spaces, not tabs. If you program in Visual Studio then please configure it to insert 4 spaces as an indentation in Options/Text Editor/C++/Tabs.

Location of braces

Braces must be put on the new line, not at the end of the current line:

Wrong

void foo() {
}

Right

void foo()
{
}

Code statements

Do not put many statements in one code line. The only exception could be inline function definition in a class, to make class definition more compact and easily observable.

Wrong

ProgressBar::nextTask( "Converting object A" ); auto gridA = convert( *objA_->objectMesh );
static MRVIEWER_API void nextTask()

Right

ProgressBar::nextTask( "Converting object A" );
auto gridA = convert( *objA_->objectMesh );