CS 70

Grading Guidelines

When we grade your assignments, obviously we look at the quality of your code and how well it solves the problem, but there are a number of other criteria that we're looking at, too.

Clarity

Work with excellent clarity has the following properties:

  • Written Work: Clear and easy to tell if the answer is correct or not.
  • Comments: Consistently make the code clearer.
  • Code: Clear and easy to believe correct or incorrect.

Elegance

Work with excellent elegance has the following properties:

  • Design: The code is modular and extensible, it uses helper functions where appropriate, it does not leak implementation details, and it uses library calls where appropriate.
  • Good Practices: The code does not employ techniques that would be hurtful in large projects.

Style

Work with excellent style has the following properties:

  • Layout and Indentation: Consistent with Google’s C++ style guide; whitespace aids readability. We have two differences from Google's suggested style

    • We use a four-character indent. Google's codebase has lots of complex and convoluted code that's heavily nested, so they need a two-character indent. Deep nesting in CS 70 code is usually a sign of deeper issues.

    • Google's style guide allows very short functions to be given all on a single line. We don't allow that.

  • No code files have lines longer than 80 characters.

  • Indentation is added using space characters, and not tab characters.

    Note: In order to check that all code lines have at most 80 characters, as well as a few whitespace considerations, use the cpplint program within our Docker image.

    Example:

    cs70 DOCKER > cpplint *.cpp *.hpp

    If your directory doesn’t have any .hpp files, you can omit *.hpp. Also, note that markdown (.md) files and Makefiles do not need to be checked with cpplint.

  • Variable Names: Descriptive and adhere to CS 70 style.

  • Code: Uses idioms where appropriate.

Overall submission quality

You are practicing how to maintain a repository, and part of your grade will take into consideration your homework repository’s quality. This includes the repository missing files, having weird extra files, not being in a compilable state, and other things that would put off experienced programmers when looking at or trying to use your repository.

(When logged in, completion status appears here.)