Deductions
Must have name, uniqname, program name, and project description at the
top of the file.
If all or part of the top comment is missing, take 1 point off.
Readability violations: -1 for each of the following categories
Indentations |
Not using a consistent number of spaces for each level of code indentation
Not indenting lines at all
Failing to indent the blocks of code inside curly braces
|
Spacing |
Not putting a space around operators (e.g., 5*7 instead of 5 * 7 or count=0; instead of count = 0;)
Not putting a space between if, while, or for and the condition to be evaluated
Putting a space between a function name and the opening parenthesis
|
Bracing |
Using a mix of Egyptian-style and hanging braces
Braces should always be used for conditionals, loops, and functions.
|
Variables |
Variable names not meaningful
Inconsistent variable naming style (camelCase vs. snake_case )
Not declaring constant variables as const
Not using all uppercase SNAKE_CASE for const variable names
Using variable types that do not make sense in context
|
Line limit |
|
Statements |
|
Comments |
Commenting on the end of a line of code
// A comment should be placed before a line of code
int count = 0; // not on the same line as the code
Insufficient comments or excessive comments
Code should be thoroughly commented such that lines’ functionality is apparent from comments alone or from quickly glancing at code
Example of appropriate comment:
// convert cups of flour to bags of flour
int bagFlour = ceil((CUPS_FLOUR * numBatches) /
CUPS_IN_LB_FLOUR);
Example of excessive comments:
// declare variable
int bagFlour;
// calculate bags of flour
bagFlour = ceil((CUPS_FLOUR * numBatches) /
CUPS_IN_LB_FLOUR);
Unneeded comments left in the code, such as:
// your code goes here
// this function doesn't work
// NEEDS TO BE FIXED
// FIXED
Commented out code, such as:
// int numBatches = people / 12;
int numBatches = ceil(people / NUM_IN_BATCH);
|
RMEs |
|
Coding quality: -2 for each of the following categories
Global variables |
|
Magic numbers |
|
Egregious code |
|
Function Misuse |
Not calling helper functions where appropriate. Examples include, but are not limited to, the following
not calling toUpperCase() inside ciphers() in ciphers.cpp
not calling removeNonAlphas() for the Vigenère cipher
not calling removeDuplicate() for the key for the Polybius Square
not calling charToInt() inside polybiusSquare()
Having tester functions remaining in your submission for the regular project (of course, does not apply to test.cpp)
|
bools |
Only deduct 1 point for this category
Writing <bool> == true, <bool != true, <bool> == false, <bool> != false
Returning 0 and 1 instead of true and false for a bool function
|