CSC 151 - Documenting Your Code
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
- CSC 151 - Code Formatting and Styleeikmeier.sites.grinnell.edu
- CSC 151 - Coding Challenge 1eikmeier.sites.grinnell.edu
- CSC 151 - Unit Testingeikmeier.sites.grinnell.edu
- Best practices for Claude Code - Claude Code Docsanthropic.com
- 15-410 Coding Style and Doxygen Documentationcs.cmu.edu
- Reading 4: Specificationsweb.mit.edu
- Function Lengthmartinfowler.com
- Reading 4: Code Reviewweb.mit.edu
- styleguide | Style guides for Google-originated open-source projectsgoogle.github.io
- How Stripe creates the best documentation in the industrymintlify.com
- Introducing FrontierCode | Cognitioncognition.ai
- Reading 6: Specificationsweb.mit.edu