Skip to content

Commit

Permalink
format doc alteration
Browse files Browse the repository at this point in the history
  • Loading branch information
LucidCrux committed Feb 8, 2014
1 parent ce631f3 commit a14cc40
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CODE_FORMATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@ relatively consistent and readable. No one is going to kill you if you mess up,
but it is nice to keep things looking consistent throughout.

1. Operators and Keywords are spaced out.

Examples:
````
Bad: if(a+b==c){return;}
Good: if (a + b == c) { return; }
````

2. Capitalization:
- High order Objects (similar to classic classes) get capitalized.
- Variables serving as constants are ALL_CAPS with underscore spacing
- Everything else is camelCase

Examples:
````
Bad: Book.page = {
pageNumber: 0,
font: 'arial',
Expand All @@ -26,12 +31,15 @@ but it is nice to keep things looking consistent throughout.
Bad: var maxPagesPerBook = 100; // This is a constant variable, do not change in code!
Good: var MAX_PAGES_PER_BOOK = 100;
````
3. Comments:
- Use block javaDoc style comments for large blocks or code sections.
(The extra space for * lines is not mandatory, just done automatically by some editors.)
- Leave a space after double slash for in-line comments, capitalize them, use [brackets] for special distinctions

Examples:
````
Bad: //++++++++++
// Section for Math stuff
//===================================
Expand All @@ -42,5 +50,6 @@ but it is nice to keep things looking consistent throughout.
Bad: //this variable is temporary for testing reason
Good: // [TEMP] Variable for testing purposes only
````
4. Leave a blank line at the end of all documents.

0 comments on commit a14cc40

Please sign in to comment.