CST 8152 - Compilers - Marking Code Key
This is the set of comment codes I use to mark your programming assignments. You will find these code words circled on your program listings. If you have further questions, come see me during Lab time or office hours.
CODE | Meaning |
ALG | Not in Algonquin College coding standard format (missing comments, style, etc.) |
BOUND | If declared as x[10] don't use x[10] = value or x[-1] = value |
CEOF | Don't continue to read input streams that have hit EOF unless you can clear the EOF |
DEF | Use meaningful UPPER_CASE #define (or enum) for all numbers and constants |
DOS | Don't use DOS- or Windows-specific functions. Write portable code. |
DUP | Duplicated code -- should be combined. Less code is better code. |
EOF | Missing or mishandled test for EOF sentinel value (-1) or EOF condition |
ERR | Put names and sizes in error messages, don't just say "too big" or "can't open" |
FAT | Don't keep going if something fatal happens; exit or return |
FMT | Brace alignment, indentation, line length, or other formatting problems |
ID | Assignment not identified according to course guidelines |
INIT | Using variables or strings before initializing them. |
INP | Read input in only one place, not spread around in the code |
INT | Function fgetc() returns an integer, not a character; needed for EOF test |
LOOP | Avoid huge long loops and nested constructs going over page boundaries |
MEM | Probable memory corruption (using freed memory, pointer confusion, etc.) |
MIS | Missing or incomplete program header, or header does not match code |
NAM | Poor names for identifiers (length/similarity/meaning, etc.) |
NUL | Confusion between '\0' and NULL and 0 |
OPN | Don't close files that may not be open |
OUTP | Output or code doesnt conform to given assignment specifications |
OVR | No check for buffer overflow; program will fault on some input |
PER | Use perror() to give the real error message for this error |
PRT | Printing or storing in output of unprintable characters; use isprint() |
PTR | Use ptr[count] rather than *(ptr + count) |
RET | No check for return value of function (especially fclose()) |
SIZE | Pass in sizes of buffers to functions that use the buffers (to prevent overflow) |
STK | Function returns a pointer to local stack storage; this is forbidden |
TST | Missing or incomplete testing strategy |
TTY | Only clear EOF if reading from a terminal (see isatty()) |
TYP | Type mismatch (e.g. char */int, void/int, etc.) |
UNK | Redundant, unknown, incorrect, or unnecessary code or feature |
UNR | Unreadable printout or indecipherable writing |
UPR | #define and enum constants are always ALL_UPPER_CASE (the only use of all upper case); variables, typedefs, function names, etc. are lower- or mixed-case |
YEL | DON'T YELL ERROR MESSAGES AT YOUR USERS; use mixed-case messages and don't blame them for everything! |