Open main menu

CDOT Wiki β

Changes

Team Mighty Morphin Coding Rangers - OOP344

133 bytes added, 12:41, 24 January 2010
m
Coding Style - changes spacing from 2 to 4, added empty line after variable declaration
<li>Class names must begin with a capital letter</li>
<li>Tab/space two four (24) spaces for every block of code. For example: </li>
<code>
main () { <br/><br/> int x, y; <br/><br/> for (x = 0, y = 10; x < 10 && y > 0; x++, y++) { <br/> printf("x is %d, y is %d\n", x, y); <br/> printf("The sum of x and y is %d\n", x + y); <br/> if (x == 5) <br/> printf("We've reached the halfway point!\n"); } <br/><br/> printf("Hello, world!"); <br/>
} <br/>
</code>
<li>Only <code>main ()</code> will start at column 1. Tab every block of code two four spaces over.</li>  <li>Include an empty line after the declaration of variables (see above example).</li>
<li>When using operators, make sure to have a space between the operands and the operator for readability.
1
edit