02. Names
2.1 Types use lower_snake_case
Type names should always be lower_snake_case. This includes all types: structs, classes, typedefs, traits/interfaces, enums, etc.
my_new_type := class
2.2 Interfaces are adjectives
Interfaces should be adjectives where possible, such as printable, enumerable. Where adjectives don’t seem right, append _interface
to the name instead.
my_new_thing_interface := interface
2.3 PascalCase everything else
All other names should be PascalCase. Modules, member variables, parameters, methods, and so on.
MyNewVariable:my_new_type = …
2.4 Parametric Types
Name parametric types t or thing, where thing explains what the type is supposed to represent. For example:
Send(Payload:payload where payload:type)
You’re sending some parameterized data,Payload
, of anypayload
type.If there’s more than one parametric type, avoid using single letters, such as
t
,u
,g
Never use
_t
suffix.
Was this helpful?