STYLE GUIDELINES
CS4354 SummerII 2014
Jill Seaman

File structure:
—Each class should be contained in a separate file.
—Each class should be inside a package, and in the corresponding directory in the zip file when submitted.

Javadoc comments:

Javadoc comments are required to describe each class and public method.

The following tags are required when applicable:
@author (for each class, one tag per author)
@param 
@return
@throws

Example:
/**
 * Returns a card rank as "A", "2", ..."J", "Q", "K"
 * @param r a rank (1-13)
 * @return the rank of the parameter as a string.
 */

String rankString(int r)  {
   // function body goes here
}

General comments:

All instance variable definitions should be commented as follows:

int  rank;    // numeric value for the card, A=1, J=11, Q=12, K=13

If the body of your method is long, one comment per section is a good idea.

Variable names:
—Must be meaningful
—Loop index names can be simple (i, j, k, etc)
—The initial letter should be lowercase, following words should be capitalized, no other caps or punctuation (ie: weightInPounds)

Named constants:
—Use for most numeric literals, including array sizes
—All capitals with underscores (ie: TX_STATE_SALES_TAX)
—Use static elements only when truly necessary

Line length of source code should be no longer than 80 characters (no wrapping of lines).

Indentation:
—Use 2-4 spaces (but be consistent throughout your program).
—Indent blocks, within blocks, etc.
—Use blank lines to separate sections.