SECTION 1
Historical Context & Motivation
Writing code is only half the battle. From the earliest days of computing, programmers have struggled with a persistent problem: how do you make sure that someone else — or even your future self — can understand what a program does and why it was built that way? The practice of presenting finished programs with clear documentation evolved over decades as software projects grew from single-page scripts to systems containing millions of lines of code. Understanding this history helps explain why professional developers today spend nearly as much time on documentation as they do on writing code itself.
1960s • Inline Comments Emerge
1974 • Kernighan & Ritchie Publish 'The C Programming Language'
1999 • Javadoc & Auto-Generated Docs
2008 • GitHub Popularizes the README
2020s • Documentation as a First-Class Skill
This history reveals a central question that applies to every project you build: If you hand your program to someone who has never seen it before, can they understand what it does, how to run it, and why you made the choices you did? That question is the focus of this entire lesson.
SECTION 2
Core Principles of Program Presentation
Presenting a finished program is more than pasting your code into a document. It requires thinking about your audience — someone who needs to run your code, understand your logic, and potentially modify it later. The following core principles form the foundation of effective program presentation.
Clear Instructions
Documented Design Choices
Trade-Off Transparency
Readable Code
Audience Awareness
KEY TAKEAWAY
SECTION 3
Anatomy of a Well-Presented Program
The diagram below maps out the key components you should include when presenting a finished Python program. Think of it as a checklist: each box represents a section of your deliverable, and the arrows show the natural reading order for someone encountering your project for the first time.
Notice how the first five components are about communication rather than coding. A common mistake is to submit a program with no README and no comments, forcing the reader to reverse-engineer your intentions. That approach might work for a 10-line script, but it falls apart quickly for anything larger. By following this structure, you give your audience a guided tour of your project from the outside in — starting with the big picture and ending with the details.
SECTION 4
How It Works — Writing Each Component
The README File
A README (often written as README.md using Markdown) is the first file a reader sees in your project folder. It should answer three questions immediately: What does the program do? How do I run it? and Why was it built this way? Below is a template for each section you should include.
Section-by-Section Breakdown
Project Title & Purpose. Start with a one- or two-sentence summary. For example: "This program simulates a text-based adventure game where the player navigates a dungeon, collects items, and battles a final boss." Keep it concrete — avoid vague phrases like "This is my Python project."
Setup Instructions. List every step required to run the program. Include the Python version you used (e.g., Python 3.10), any third-party libraries (installed via pip install), and the exact command to run the program (e.g., python main.py). If your program reads from a file, mention where that file should be placed.
Usage Examples. Show a sample interaction: what the user types and what the program outputs. This is like a screenshot in text form. It removes ambiguity and helps the reader verify that the program is working correctly on their machine.
Design Choices. This is where you explain the why behind your code. Did you store data in a dictionary instead of a list? Explain the reason — perhaps dictionary lookups are faster for your use case. Did you break the program into multiple functions? Explain that it improved readability and made testing easier.
Trade-Offs & Limitations. Be honest about what your program does not do well. Maybe it doesn't handle invalid input gracefully, or it slows down with very large data sets. Acknowledging limitations shows maturity and critical thinking — two qualities that teachers and employers value highly.
Inline Comments in Your Code
Inside the Python source file, use inline comments (lines beginning with #) and docstrings (triple-quoted strings at the top of a function) to explain your reasoning. A good comment explains why a line of code exists, not what it does — the reader can see the what by reading the code. For example, # Use a set to eliminate duplicate entries quickly is far more useful than # Create a set.
Tip: The "Why" Test
SECTION 5
Documenting Design Choices & Trade-Offs
One of the most important — and most overlooked — parts of presenting a program is explaining your design choices and trade-offs. A trade-off occurs whenever you pick one approach over another, gaining some benefit but giving up something else. In programming, almost every decision involves a trade-off, and documenting these shows that you understand your own code on a deeper level.
When you document a trade-off, use this simple template: "I chose [Approach A] over [Approach B] because [reason]. The downside is [limitation], but this was acceptable because [justification]." For example: "I chose a dictionary over a list to store player inventory because dictionary lookups by item name are O(1) instead of O(n). The downside is that items are not stored in the order they were collected, but for this game the order does not matter."
What Does O(n) Mean?
O(n) or O(1) when discussing trade-offs. This is called Big-O notation, and it describes how the time a program takes grows as the input size increases. O(1) means constant time (always fast), while O(n) means the time grows proportionally to the number of items. You don't need to master Big-O right now, but mentioning it in your presentation shows a deeper understanding of your choices.SECTION 6
Worked Example — Presenting a Mini-Project
Let's walk through a complete example of presenting a finished Python program. The project is a simple quiz game that asks the user five trivia questions, scores their answers, and displays a final result. We will build every component of the presentation step by step.
Presenting the Quiz Game
- 1
Step 1 — Write the Title & Purpose
Begin your README with a clear, specific title and a one-sentence summary. For our quiz game, this might read:# Trivia Quiz Gamefollowed by "A command-line Python game that asks five multiple-choice trivia questions, tracks the user's score, and displays the results at the end." Notice how the summary tells the reader exactly what to expect.Title: "Trivia Quiz Game" — Purpose: five-question scored trivia quiz. - 2
Step 2 — Write Setup Instructions
List every prerequisite and the exact run command. For this project: "Requires Python 3.8 or later. No external libraries needed. Run the game with:python quiz.py" If your project did require an external library, you would add a line such aspip install coloramaand explain what it is used for.Setup: Python 3.8+, no external libraries, run withpython quiz.py - 3
Step 3 — Provide a Usage Example
Show a snippet of what a real session looks like. For instance:Question 1: What is the capital of France? (a) London (b) Paris (c) Berlin > b Correct!This gives the reader a mental model of the program's behavior before they even run it.Sample interaction demonstrates input prompt and feedback. - 4
Step 4 — Document a Design Choice
"I stored the quiz data as a list of dictionaries rather than separate parallel lists. Each dictionary holds the question text, the answer options, and the correct answer key. This makes it easy to add or remove questions without having to update multiple lists in sync." This sentence follows the template: I chose [A] over [B] because [reason].Design choice: list of dicts for maintainability over parallel lists. - 5
Step 5 — Acknowledge a Trade-Off
"A limitation of this program is that questions are always asked in the same order, which makes it easy to memorize the sequence. I could have usedrandom.shuffle()to randomize the order, but I prioritized reproducibility for grading purposes. In a future version, I would add a flag to toggle randomization." Notice how this trade-off is honest, explains the reasoning, and suggests an improvement.Trade-off: fixed question order (reproducibility) over randomization (replayability). - 6
Step 6 — Add Inline Comments to the Code
Insidequiz.py, add comments that explain why, not what. For the scoring logic you might write:# Increment score only for exact matches to keep grading strictabove the lineif user_answer == correct_answer:. Also include a docstring at the top of each function, e.g.,"""Display a question and return True if the user answers correctly."""Inline comments and docstrings explain intent, not syntax.
PUTTING IT ALL TOGETHER
SECTION 7
Good Presentation vs. Poor Presentation
Seeing side-by-side examples is one of the fastest ways to internalize what makes a presentation effective. The table below contrasts strong and weak examples across every component of a program presentation.
| Component | Poor Example | Strong Example |
|---|---|---|
| Title & Purpose | "My Python Project" | "Trivia Quiz Game — a CLI quiz with five scored questions" |
| Setup Instructions | "Just run the file." | "Requires Python 3.8+. Run with: python quiz.py" |
| Usage Example | (none provided) | Shows sample input/output of a full game session |
| Design Choice | "I used a list." | "I used a list of dicts so each question bundles its text, options, and answer together." |
| Trade-Off | (not mentioned) | "Fixed order sacrifices replayability for reproducible grading." |
| Code Comments | # add 1 to score | # Only exact matches count, to prevent partial-credit loopholes |
Comparison of poor and strong presentation practices
KEY TAKEAWAY
SECTION 8
Connection to Professional Software Development
The skills you are building now translate directly into professional software development practices. The table below compares the classroom version of each presentation skill with its professional counterpart. If you continue into computer science, you will encounter these concepts repeatedly.
| Classroom Skill | Professional Equivalent |
|---|---|
| README with title and purpose | Project documentation site (e.g., Read the Docs, GitHub Wiki) |
| Setup instructions in README | Automated setup scripts, Docker containers, CI/CD pipelines |
| Usage examples with sample I/O | API documentation with request/response examples (e.g., Swagger) |
| Documented design choices | Architecture Decision Records (ADRs) maintained in version control |
| Trade-off acknowledgement | Design review meetings, RFC (Request for Comments) documents |
| Inline comments and docstrings | Auto-generated API docs from docstrings (e.g., Sphinx for Python) |
Mapping classroom skills to professional practices
In advanced courses and professional teams, you will also encounter version control (Git), code reviews, and automated testing — all of which depend on clear documentation to function smoothly. The habits you develop now in presenting your programs will give you a significant head start when you reach those stages.
Looking Ahead
SECTION 9
Practice Problems
Question 1: CONCEPTUAL
Show answer
Question 2: BASIC CALCULATION
scores = {} # create a dictionary. Write a replacement comment that explains why the dictionary is used.Show answer
scores = {} # Use a dict to map player names to scores for O(1) lookup. This version explains the intent behind choosing a dictionary over another data structure. It tells the reader that fast lookup by player name is important, which is much more informative than simply restating that a dictionary is being created.Question 3: INTERMEDIATE
Show answer
Question 4: APPLIED
Show answer
Question 5: CRITICAL THINKING
Show answer
SUMMARY
Lesson Summary
Summary
Presenting a finished program means delivering more than working code. A complete presentation includes a README file with a clear project title and purpose, step-by-step setup instructions, concrete usage examples, explained design choices, and honest trade-offs and limitations. Inside the code itself, inline comments and docstrings explain the why behind your logic rather than merely restating what the code does.
The trade-off template — "I chose [A] over [B] because [reason]; the downside is [limitation], but [justification]" — gives you a repeatable structure for documenting decisions at any scale. These habits map directly to professional practices like Architecture Decision Records and design review documents. By consistently presenting your programs with clarity and transparency, you make your work accessible to others, demonstrate critical thinking, and build skills that will serve you throughout your programming career.