Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 1.99 KB

CONVENTIONS.md

File metadata and controls

33 lines (23 loc) · 1.99 KB

Conventions followed

We try to adhere to existing standards whereever sensible, but are sometimes following slightly different conventions where it made sense. We are also very happy to pragmatically deviate from these conventions wherever is makes sense.

Naming

  • Classes are in CamelCase
  • functions, methods, variables and attributes are in lowercase_with_underscores
  • variables of type Map or Set have _map or _set in their name (see below).

There are two main exceptions to this.

  1. Methods that override parent class functions or that are in some sense "standard methods" use CamelCase if that is the general convention for such methods. An example of this is onClick instead of on_click.
  2. Attributes that are very frequently used and complex, such as services, are named using uppercase letters as follows:

Data structures

As container data structures, we use Maps, Sets, Records, and standard Arrays.

Therefore, special care has to be taken not to confuse their syntax for accessing and looping over entries, which can cause very hard-to-identify bugs. There is a cheat sheet summarizing the differences.

For this reason, all variables of type Map or Set have _map or _set in their name.