Code Style

Table of Contents

1. Enforcing

It's OK to leave code style of old code as is. New code should conform to the code style, unless there is a good reason not to.

2. Capitalization

  • classes and structs: CapitalizedWords
    • example: EventHandler, Array
    • exceptions: string, vector2, vector3, name
  • classes with prefix: prefix_CapitalizedWords
  • functions: camelCase
  • constants: ALL_CAPS
    • exceptions: CapitalizedWords if they contain no underscores
    • exceptions: enumeration-like: PREFIX_CapitalizedWords
  • class members: mCapitalizedWords
    • exceptions: camelCase if a class is plain data
  • struct members: camelCase
  • local variables and parameters: camelCase
  • states: CapitalizedWords
  • properties: CapitalizedWords
  • console variables and aliases: snake_case
  • project names: CapitalizedWords.
    • exceptions: external projects imported into DoomToolbox, like libeye
    • exceptions: Typist.pk3, 10.5x
  • file names: CapitalizedWords
    • exceptions: tangled ZScript files: snake_case

3. Formatting

4. Abbreviations

Minimize the use of abbreviations. Capitalize abbreviations as single words (Http, Cvar).

5. Language

See ../.dir-locals.el for spellcheck settings.

6. Encoding

ASCII or UTF-8.

Created: 2026-05-04 Mon 07:20