STYLE GUIDELINES
CS2308 Spring 2017
Jill Seaman

Header comments (file documentation block) should be at the top of each file and should contain:
File Name, Author, Date, Assignment Number, Course number and section, Instructor, and a brief description of the purpose of the code in the file.

// File Name: assign1_js108.cpp
// 
// Author: (Your name here, followed by co-authors if any)
// Date: 1/10/2017
// Assignment Number: 1
// CS 2308.256 Spring 2017
// Instructor: Jill Seaman 
// 
// Initializes name and number for each soccer player, User inputs points for each player.
// Outputs table of players number, name, points scored, then total points earned by team,
// and name of player scoring the most points.

#include directives must follow header comments, before the rest of the program.

Variable names:
--must be meaningful, "self-documenting"
--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)  Also known as “camel case” or “camel caps”.

Named constants:
--use for most numeric literals, including array sizes
--all capitals with underscores (ie: TX_STATE_SALES_TAX)
--should occur at top of function, or global 

DO NOT USE GLOBAL VARIABLES!!

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

Indentention:
--Use 2-4 spaces (but be consistent throughout your program).  Don’t use tabs.
--Indent blocks, within blocks, etc.
--Use blank lines to separate sections.

Comments:

Function definitions should be commented to describe what the function does, what the parameters are, and what the function returns (when appropriate).  This comment should precede the function definition.  See the template and the example below.  

Template:
//***********************************************************
// function name: short description of what the function does.
//
// param-1 description of first parameter (if any)
// param-2 description of second parameter (if any)
// (remaining params, if any)
// returns: description of what function returns (if not void)
//***********************************************************

Example:
//***********************************************************
// getHighestPlayer:  determines which player scored the most points
// p the array of player information
// size the number of players in the array
// returns the name of player who scored the most points
//***********************************************************

string getHighestPlayer(Player p[], int size) {
   // function body goes here
}

in-code comments: DO NOT comment evey line of code!  In general, try to avoid using comments that describe WHAT the code is doing.  These are redundant (we can just read the code).  Comments that explain WHY the code is doing what it is doing are more helpful.  Try to minimize in-code comments, and write readable code instead.