Skip to content

Style Guide

Malachi edited this page Nov 2, 2024 · 3 revisions

Document v0.1

1. Scope & Overview

2. Guidelines

2.1. Capitalization

2.1.1. Core

These guidelines apply to core library conventions under our complete control, with only minor influence from 3rd parties:

class and struct MUST be pascal case, unless an inner class or struct.

inner class or struct SHOULD be pascal case, otherwise MUST be snake case.

functions (excluding constructors and destructors) MUST be snake case.

enum names SHOULD be pascal case, otherwise MUST be snake case.

non-class enum enumerator MUST be CAPS case.

class enum enumerator SHOULD be snake case.

typedef/using MUST be either snake case or pascal case

namespace MUST be snake case and shorter than 15 characters

2.1.2. Extended

These guidelines apply to library conventions directly interacting with and reflecting 3rd parties code, such as wrapper code.

Terminology

Term Context Description
CAPS case My unofficial term for Screaming snake case
Camel case [1] All words except first capitalized i.e. helloWorld
Kebab case [1] All words lowercase, separated by hyphen i.e. hello-world
Pascal case [1] All words capitalized i.e. HelloWorld
Screaming snake case [1] All words uppercase, separated by underscore i.e. HELLO_WORLD
Snake case [1] All words lowercase, separated by underscore i.e. hello_world

References

  1. https://medium.com/@code.ceeker/naming-conventions-camel-case-pascal-case-kebab-case-and-more-dc4e515b9652
Clone this wiki locally