CIS 1033 - Fundamentals of Programming
Program Documentation and Style
One of the requirements of this course is that you program in a professional programming style. 20% of your grade on each programming assignment will be based on program documentation and style. The goal is to make your program easy to read and understand. Click here for an example program with documentation.
- You should follow a standard indentation style that highlights the structure of your program. I like the indentation style used in our textbook, but as long as you consistently follow a neat, professional looking style, I won't complain.
- Each program must begin with a comment that includes:
a) your name,
b) the date the program was completed,
c) program status - either "Complete" or describe any incomplete or non-functioning part of your program,
d) program description - a brief 1 to 3 line description of what the program does, and
e) your algorithm (pseudocode).
- In your source file, the code for the main function should come first followed by the code for your other functions.
- Each function should begin with a 1 to 3 line comment describing what the function does.
- If a function is longer than 5 or 10 lines, it should be divided into sections of related statements (like paragraphs). Include a 1 or 2 line comment at the beginning of each section describing what the section of statements does. Include a blank line between sections.
- All local variables and constants should be declared at the beginning of the function body.
- Use meaningful variable names. One or two character names are rarely meaningful. For example, c and ch would not be acceptable names for a variable that holds the change returned from a purchase. chng is OK. change and changeDue are even better.
- Declare one variable or constant per line and include a comment to the right describing how the variable or constant is used.
Return to C++ Home Page
URL: http://www.austin.cc.tx.us/comer/cis1033/
Copyright: Ó 1999 by the Austin Community College.
Department of Computer Studies. All rights reserved.
Comments to: Bob Comer
Last updated: January 26, 1999
Austin Community College is an equal opportunity educator and employer.