Skip to content

Instantly share code, notes, and snippets.

@thestr4ng3r
Last active May 21, 2020 11:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thestr4ng3r/d0b1de10852ca3d119e8c83375211e4b to your computer and use it in GitHub Desktop.
Save thestr4ng3r/d0b1de10852ca3d119e8c83375211e4b to your computer and use it in GitHub Desktop.
thestr4ng3r Code Style

thestr4ng3r Code Style

Indentation is done with tabs, not spaces. Tabs are 4 spaces wide.

Braces follow Allman-style with brace-less single-line statements being allowed and encouraged when it does not make things less readable:

There are no spaces between parenthesis and function names, if, for, etc.

Names can be either in UpperCamelCase or snake_case, but it should be consistent across the whole project. lowerCamelCase is used never except when using anything else would make the code awkward, for example on Android.

Correct:

int example()
{
	if(something)
	{
		int r = another_function(42);
		return r;
	}
	else
		return 0;
}

Wrong:

int example () {
	if (something) {
		int r = anotherFunction (42);
		return r;
	} else {
		return 0;
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment