C++ Coding Standards

Revised: January 2017

There are three kinds of coding standards: obligatory, advisory and aesthetic. The obligatory coding standards exist to ensure that your program can be compiled, executed and graded. Naturally, if your program does not compile, does not run or is unreadable by a human being, there will be major deductions from your grade. Obligatory standards also exist to ban some very bad programming practices. The advisory coding standards are "good for you". They help you maintain your code and avoid nasty bugs. If you do not follow advisory coding standards and run into nasty bugs, then it is your own fault that your program is late or does not work. The aesthetic coding standards keep your code pretty. These are the most controversial since reasonable people will disagree on what is pretty. However, since there is much agreement on what is ugly, you may lose points on your project if your code is ugly, because no one wants to stare at ugly code all day long.

It is your responsibility to understand these standards. If you have any questions, ask your instructor or any of the TAs.


General


File Organization


Documentation and Formatting