Problem Set 6 Grading Guidelines
Before diving into the specifics of grading DNA, here are a few general principles for grading the design of Python submissions.
A few points in common with grading C:
- Naming. Stylistic conventions regarding variable names are similar: not too many single-variable names, use a descriptive name wherever possible, use i-j-k for loops.
- Commenting. Commenting conventions are no different—comments should still be ultimately designed to aid reader comprehension.
- Scoping. Whether in C or Python, follow the same principle: define variables in the smallest possible environment, replace global variables with local variables if at all possible.
A few points unique to Python:
- Pythonic Implementations. “Pythonic” constructions are often preferable to “non-Pythonic” ones. In general, “Pythonic” means that students leverage the unique capabilities and advantages of Python wherever possible.
- For instance, using Pythonic list comprehensions (
for _ in _
) is often more natural than doingfor i in range()
every time. - Dictionaries are a key data structure in Python. If a student’s code could be simplified by using a dictionary, or seems contorted in its efforts to avoid using dictionaries, that’s worth considering.
- If a variable that’s “unpacked” from another variable (i.e.,
foo, bar = foobar
) goes unused, it should be given the name_
, which signifies it is to be thrown away. - Use the
with
keyword to open files when applicable, since this construction automatically takes care of closing the file once you’re done with it. - And so on. This is not an exhaustive list.
- For instance, using Pythonic list comprehensions (
- Around now, CS50 transitions from depth to breadth. Students are now expected to pick up many different concepts and constructions rather quickly. Thus, it’s much more likely students will to find and use new ideas you haven’t covered. This isn’t to be discouraged: rather, the goal is to get students to a state where they can fill in their own gaps in knowledge.
Problem-Set-Specific Guidelines
- Mario
- Cash
- Credit
- Readability
- DNA