Short checklist for turning in programs
for courses taught by Karl Abrahamson

Please follow these rules for designing computer programs. If you fail to follow these, you risk having your grade lowered, or even receiving a 0.

  1. Read the assignment carefully, and be sure that your program does what the assignment asks. If you do not understand the assignment, get clarification.

  2. Turn in all source files that are part of your program. Be sure that your name is in every one of your source files.

  3. Do not plagiarize, unless you are willing to see an F on your transcript. Putting your name on someone else's work is plagiarism.

  4. Programs must compile, and should compile without warnings. I will not grade a program that does not compile, and will grade you down for ignoring warnings. Turn warnings on when compiling.

  5. Programs must be well-indented. I will not grade a program with extremely poor indentation. Either set tab stops to every 8 characters or do not use tabs. (Otherwise I have to figure out what your tab setting is.) See the Unix expand command.

  6. Provide a clear, precise and concise contract for every function. Use correct grammar and spelling in contracts. A contract should tell just what the function does without going into details on how it accomplishes its job or what tools it uses to accomplish its job.

  7. Use technical terms correctly in comments. If you use the words precondition and postcondition in your comments, be sure that your precondition and postcondition are genuinely assertions, not just more comments.

  8. Avoid long lines. Keep lines no more than 80 characters long.

  9. Avoid margin comments. Use paragraph comments instead.

  10. Test your program thoroughly. Do not be lulled into a false sense of security because your program passes one or two very simple tests.

  11. Do not link source files together by including a source module (.cpp, etc.) in another source module. Include header files instead, and use a linker.

  12. NEVER turn in a program in a non-text format, such as Microsoft word.

  13. Convert files to Unix format whenever possible. (DOS/Windows format uses CR-LF to end a line. MacIntosh format uses just CR. Unix uses just LF. See the Unix dos2unix command.)

  14. Avoid magic numbers embedded in your program. Do not write 48 for '0' in your program. Do not create arrays of fixed sizes that are awkward to change without very good justification. A rule of thumb is that if you see any number other than 0, 1 or occasionally 2 in your program anywhere other than in the definition of a constant, you are probably doing something wrong.