From bb82a3c6be6f0ab78b5d5749fdd6600d72a3c90f Mon Sep 17 00:00:00 2001 From: Carlos Daniel Ruvalcaba Valenzuela Date: Sun, 2 Sep 2007 10:39:10 -0700 Subject: [PATCH] Started Documenting Coding Style --- docs/codingstyle.txt | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 docs/codingstyle.txt diff --git a/docs/codingstyle.txt b/docs/codingstyle.txt new file mode 100644 index 0000000..15c0a49 --- /dev/null +++ b/docs/codingstyle.txt @@ -0,0 +1,99 @@ + +Spaces + + +Identation + +Code should be idented with tabs. + +Reason: + +Code readability + +Examples + +Good: + +int func(){ + int i; + + for (i = 0; i < 100; i++){ + /* Do something */ + } +} + +Bad: + +int func(){ +int i; +for (i = 0; i < 100; i++){ +/* Do something */ +} +} + +For Loops + +For construct should have an space after "for", there should not +be spaces between the parenthesis. + +Reason + +Examples + +Good: + +for (i = 0; i < 100; i++){ +} + +Bad: + +for( i = 0 ; i < 100 ; i++ ){ +} + + +Brackets + + +Loop Brackets + +They should be on the same line of the loop construct. + +Reason: + +Probably wastes a line. + +Examples + +Good: + +for (i = 0; i < 100; i++){ + +Bad: + +for (i = 0; i < 100; i++) +{ + + + + +Function Brackets + +They should be in the same line of the function. + +Reason: + +Having the brancket in the next line wastes a line, probably +doesn't adds to much to readability. + +Examples + +Good: + +int main(int argc, char **argv){ + +Bad: + +int main(int argc, char **argv) +{ + + -- 2.11.4.GIT