Skip to content

Style Guideline

Jose Jimenez edited this page Jan 25, 2021 · 23 revisions

File Headers:

/**
 *
 * Jose Jimenez 
 * Brandon Cramer
 *
 *                 University of California, San Diego
 *                      IEEE Micromouse Team 2020
 *
 * File Name:   <Name>
 * Description: <Short Description>
 */

Routine Headers:

Routine Headers will be in parallel with the Javadocs. Every header should have a short description of its role, a short description for all formal parameters, and what the function expects to return. An example is as follows:

/**
 * Two pairs are equal if the content in the pair are equivalent order does 
 * not matter.
 * @param o object of comparison.
 * @return true if pairs have the same content.
 */
@Override
public boolean equals( Object o ) {
  ...
}

Indentation:

Two space indentation. (NOT tabs)

Inline Comments

Use the following format:

if( condition ) {
  /* <comment> */
  ...
}

Parenthesis Clauses:

For consistency make sure to leave whitespace on conditional clauses in between the parenthesis. Example:

if( condition ) {
  ...
}  

Nested parenthesis clauses do not have to follow this rule. Example: this is ok

if( foo(a, b) ) {
  ...
}

Max Characters per Line:

The recommended maximum number of characters on a line is 81.