Open main menu

CDOT Wiki β

Changes

Team !YOU - OOP344

404 bytes added, 13:14, 25 January 2010
m
Discussion: Indentation
Don't:
int a, b = 0, c = a;
 
=== Do not use tabs when indenting. ===
The tab space is interpreted different across different software and operating systems. Use normal spaces to add indentation instead.
 
=== Put the pointer identifier(*) right after the target variable type. ===
int *p1;
char *p2;
 
=== (Discussion: Use of iterating variables on for loops) ===
|-
|}
 
=== (Discussion: Variable names) ===
|-
|}
 
=== (Discussion: Use of comments) ===
|-
| fmDeOliveira || I prefer using // for single-line comments and /* */ for blocks of commented code. This would avoid problems commenting out blocks of code that already have single-line comments (the end of the single-line comment would not be interpreted as the end of the block comment).
|-
|}
 
 
=== (Discussion: Indentation) ===
Something simple, but that should be standard for all pieces of the code.
 
 
{| class="wikitable" border="1"
|+ Discussion
! Name !! Comment
|-
| fmDeOliveira || I usually put two spaces for a new indent, and keep a blank line between new big blocks of code and whatever comes before it (usually an if statement, a for loop, or the signature of a function).
|-
|}