UMBC CMSC 202 Spring 2001 CSEE | 202 | 202 Spring 2001

CMSC 202 Coding Standards

File Organization

The organization and structure of the files for a C++ program is important. Poorly organized files make code maintenance and debugging difficult. Here are the rules for file organization for projects:


Documentation

Every file is to be headed by comments giving the name of the file, your name, the creation and current dates, and a brief description of the file's contents.

The header file for a class presents the public interface for the class. We adopt the convention that class documentation is done in the header file. Implementation files may be documented also, but this is documentation for the programmer, not for the class user.

For an example of header file documentation, see the sample header. You are encouraged to adopt this sample style. If you prefer your own style, that's ok, but it must meet the specifications laid out here.

Documentation of a class is to include the following information:


Style

There is no universally-accepted coding standard for C++ programs. When you get that super high-paying job after graduation, you will most likely have to work to some coding standard. Most standards are arbitrary, but serve the important function of making your code more readable for others following the standard. Standards can also help in bug detection. Standards are good, but there is no one good standard.

For projects in this class, use the following coding standard:


Makefiles

Every project must be submitted with an associated makefile. The makefile is to be named either Makefile or makefile, your choice. No other names are acceptable for your makefile.

The grader will compile your submitted project by typing 'make,' so your makefile must correctly make your project. This includes correct naming of the executable.

A number of tutorials on makefiles are available. One is the UCS tutorial. Another is an excerpt from the GNU tutorial.


Last modified on Monday Jan 22, 2000 by Dennis Frey
email: frey@cs.umbc.edu