Difference between revisions of "Team Mighty Morphin Coding Rangers - OOP344"

From CDOT Wiki
Jump to: navigation, search
m (/ *Deleted the team members table to make way for coding updates (which will commence soon)*/)
m (Updated page to include coding style of the team)
Line 1: Line 1:
The Coding Rangers to date have not begun any sort of coding.
+
= Coding Style =
 +
 
 +
The Coding Rangers had their first somewhat informal meeting on Jan. 21 to determine a uniform coding style. They came up with the following:
 +
 
 +
<ul>
 +
  <li>Comment as much as you can using /* ... */.</li>
 +
 
 +
  <li>Change to newline once you reach <b>column 80</b>. Nothing to be typed beyond column 80!</li>
 +
 
 +
  <li>When naming variables,
 +
    <ul>
 +
    <li>use single letters (like i, j, a, or v) for counters only. </li>
 +
    <li>assign the name that best describes what a variable is used for
 +
      (but please don't make it too long)</li>
 +
    <li>separate words with caps.
 +
      <br />Eg. no<b>O</b>f<b>O</b>rders, not no<b>o</b>f<b>o</b>rders
 +
    </ul>
 +
  </li>
 +
 
 +
  <li>Tabbing/Spacing: As most of us have decided to use vi, we have determined that <b>TABBING 2 SPACES</b> will be the norm.
 +
 
 +
  <li>Only <code>main ()</code> will start at column 1. Tab everything else two spaces over</li>
 +
 
 +
  <li>When using operators, make sure to have a space between the operands and the operator for readability.
 +
    <br/>Eg. <code>i = 0;</code>, not <code>i=0;</code></li>
 +
 
 +
  <li>For keywords such as while, for, if, else, put a space after the keyword and the expression following it.
 +
    <br/> Eg. if <code>(x==0)</code> is correct, not <code>if(x==0)</code></li>
 +
 
 +
  <li>When using brackets, put the opening bracket on the same line as the function or expression that opens it.
 +
    <br/>Eg.
 +
    <br/>int setSafeEmptyState {
 +
    <br/>...
 +
    <br/>} is correct
 +
    <br/>int setSafeEmptyState
 +
    <br/>{
 +
    <br/>...
 +
    <br/>} is incorrect
 +
  </li>
 +
</ul>

Revision as of 19:15, 21 January 2010

Coding Style

The Coding Rangers had their first somewhat informal meeting on Jan. 21 to determine a uniform coding style. They came up with the following:

  • Comment as much as you can using /* ... */.
  • Change to newline once you reach column 80. Nothing to be typed beyond column 80!
  • When naming variables,
    • use single letters (like i, j, a, or v) for counters only.
    • assign the name that best describes what a variable is used for (but please don't make it too long)
    • separate words with caps.
      Eg. noOfOrders, not nooforders
  • Tabbing/Spacing: As most of us have decided to use vi, we have determined that TABBING 2 SPACES will be the norm.
  • Only main () will start at column 1. Tab everything else two spaces over
  • When using operators, make sure to have a space between the operands and the operator for readability.
    Eg. i = 0;, not i=0;
  • For keywords such as while, for, if, else, put a space after the keyword and the expression following it.
    Eg. if (x==0) is correct, not if(x==0)
  • When using brackets, put the opening bracket on the same line as the function or expression that opens it.
    Eg.
    int setSafeEmptyState {
    ...
    } is correct
    int setSafeEmptyState
    {
    ...
    } is incorrect