Opened 5 years ago
Last modified 5 years ago
#51 new task
Write a style guide. — at Initial Version
Reported by: | mornfall | Owned by: | mornfall |
---|---|---|---|
Priority: | major | Milestone: | 5.0 |
Component: | other | Keywords: | |
Cc: |
Description
A few bullet points for now:
- indent is 4 spaces and applies to namespaces too (always use :: to nest namespaces, like namespace divine::mc { ... } )
- type and class names are CamelCase
- namespace, variable and function names are snake_case (but preferably a single word)
- opening brace goes on a separate line (can be followed by a comment; 'do' and 'try' are excepted
- parentheses get a space on the inside
- lambdas that do not fit a single line follow the same rule, opening body brace on the first column
- lambdas that do not fit on a line should probably get a name
- single-statement if/while/... do not need braces
- constructor init section goes on a separate line if the ctor does not fit a line
- line breaks in if/while/... should be after logical operators if possible
- multi-line function calls or expressions should indent to align with the same paren nesting level
Note: See
TracTickets for help on using
tickets.