Repository navigation
Code comment and formatting
Pam edited this page Mar 24, 2017
·
10 revisions
File organization and formatting
- All the front-end in the client folder
- All the collections for the database go in the collections folder
- Put all templates and sub-templates in the same file if they have similar themes. ie: if events is used as a subtemplate in "rings" events should be in a separate file, and since it can clearly be reused later. Use good judgement.
- Front end file names are capitalized
- Back end file names are not capitalized, such as mongoDB collections
- Template names are capitalized
- Method names and variables int follow the same regular convention used in javascript
Code formatting
- Include comments where necessary only. Proper use of identifiers should be appropriate enough to understand most code.
- Comments should be on the side of the appropriate line. All comments in the files should be aligned
- Braces and bracket format
methodName(){
}
For templates, opening and closing tags (Ex: {{#if}} and {{/if}}) must be aligned, everything inside must be indented
{{#each}}
{{TemplateName}}
{{/each}}
- Templates should be formatted with a title, description, functions and subtemplates if it applies.
________________________________________________________________________________
****Template name****
Description:
Subtemplates:
Functions:
________________________________________________________________________________