Open main menu

CDOT Wiki β

Changes

Team Mighty Morphin Coding Rangers - OOP344

295 bytes added, 16:11, 25 January 2010
Coding Style - Updated standardized coding style with Fardad's requirements
<li>Class names must begin with a capital letter</li>
<li>Tab/space Type four (4) spaces over for every block of code. (This is as opposed to tabbing.) For example: </li>
<code>
main () { <br/><br/>
int x, ; //Notice the four spaces over <br/> int 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");//Moved four spaces over
} <br/><br/>
printf("Hello, world!"); <br/>
<li>Only <code>main ()</code> will start at column 1. Tab every block of code four spaces over.</li>
 
<li>Every variable must be declared in a line by itself. This is to make commenting about each variable easier. See above example: x and y, though both int's, are on separate lines.</li>
<li>Include an empty line after the declaration of variables (see above example).</li>
1
edit