A good documentation does not restate the code in natural language, but gives a short description of WHAT a LOGICAL UNIT of code does. It is rarely required to state HOW the logical unit does its job, that should become apparent from reading the code, if it is well written. Exceptions from the latter are giving the source/name of the algorithm used or pointing out "hacky" solutions that had to be chosen for speed or other reasons. A logical unit for the purpose of documentation is almost never a single line of code, but could be a complete if-else-statement, a branch of an if-else-statement if sufficiently complex, a loop including body, etc. (Just in case students ask for what an allowed hacky solution is, I just used "n & 0x1" to check if an integer is odd, because I needed to speed some stuff up and the bit-check is dirt cheap. But I think it is not at all obvious that "n & 0x1" reads as is_odd().)
Assignment | Given | Due |
Assignment #1 | Jan 7 | Feb 6 |
Assignment #2 | Jan 7 | Mar 6 |
Assignment #3 | Feb 5 | Apr 3 |
Created: November 29, 2024
Last Modified: March 5, 2025