flâneur — a map of the web's best reading

CSC 151 - Documenting Your Code

eikmeier.sites.grinnell.edu · 2,878 words · saved by 1 readers

In computer programming, we design computational solutions to problems and then translate those solutions into our programming language of choice. Therefore, when we reason about the correctness of our programs, we need to do two things: The second of these things is the reason why we care about making our code readable. Even if our code’s intent is correct, we will have difficulty determining that fact if we can’t decide what the code does. This is why we emphasize the idea of *making our code mirror our intent in this course. We heavily prefer realizing our solution to a problem directly as language constructs in our code to make it painfully evident that our translation from algorithm-to-program is correct. While functional languages like Scheme make such translation easier, it is not always obvious from our code what our intent is, even with good structure and names. A great example of this is the humble substring function from the standard library: substring takes three arguments:

CSC 151 - Documenting Your Code Documenting Your Code Due Wednesday, 24 September 2025 --> Summary In this reading, we motivate the need to document our code to increase its readability and codify latent assumptions we make about our program design. We also introduce the particular format of code of documentation we will use for the remainder of the course. In computer programming, we design computational solutions to problems and then translate those solutions into our programming language of choice. Therefore, when we reason about the correctness of our programs, we need to do two things: Is

Explore this link on the map →

saved by

related reading