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.
- 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.
- 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 ofon_click
. - Attributes that are very frequently used and complex, such as services, are named using uppercase letters as follows:
D
for the DataServiceDel
for the DelegationServiceG
for the GlobalServiceL
for the LoggerN
for the NewsServiceP
for the PollServiceS
for the SettingsServiceT
for a poll's tallying data cache
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.