-
Notifications
You must be signed in to change notification settings - Fork 0
Code conventions
acasimiro edited this page Aug 28, 2012
·
14 revisions
Here are the code conventions used in komoo project.
PLEASE FOLLOW THEM!
The golden rule on naming programming objects (i.e. classes, variables, styles, functions, etc.) using more generic components firsts. Where, namely, the components are: category > entity > action > id.
Examples:
- class FormCommunity (category: Form > entity: Community)
- #community_5 (entity: community > id: 5)
- function community_edit() (entity: community > action: edit)
Obs.: This is valid for code itself, but not for the folders structure, which are organized by flask blueprints (same idea as django like apps).
- Indendation: 4 spaces
- Naming: PEP-8
- Quotes: single is preferable than double
- Indendation: 2 spaces
- Naming: namesWithMixedCase, ClassesWithCamelCases, CONSTANTS_WITH_UNDERSCORES
- Quotes: single is preferable than double
- Indendation: 2 spaces
- Naming: name_with_underscores
- Quotes: double is preferable than single
- Indendation: 4 spaces
- Naming: name_with_underscores
- Quotes: single is preferable than double