Computer Programming 1 (Python) • Problem Solving & Mini-Projects

Presenting Finished Programs — I can present a finished program with clear instructions and documented choices and trade-offs.

Learn to communicate your code's purpose, logic, and design decisions so others can understand, use, and build on your work.

A Python coding terminal with a program flow and laptop.
Inside this lesson 10 sections 5 questions 4 figures

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

Early languages like FORTRAN and COBOL introduced comment syntax so programmers could annotate code. Documentation lived inside the source file itself, since programs were often shared on physical punch cards.

1974 • Kernighan & Ritchie Publish 'The C Programming Language'

This book set a standard for presenting code with clear explanations, examples, and rationale. It showed that a program's presentation matters as much as the program itself.

1999 • Javadoc & Auto-Generated Docs

Tools like Javadoc allowed structured comments to be turned into browsable HTML documentation automatically, making it easier to maintain documentation alongside code.

2008 • GitHub Popularizes the README

GitHub's prominent display of README.md files made project presentation a community norm. Every open-source project was expected to have clear setup instructions, usage examples, and explanations of design choices.

2020s • Documentation as a First-Class Skill

Modern software teams treat documentation, code reviews, and design-decision records as essential parts of the development process. Companies like Google and Stripe are famous for their internal documentation culture.

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.

1

Clear Instructions

Provide step-by-step directions for installing dependencies, running the program, and supplying input. A user should never have to guess how to get started.
2

Documented Design Choices

Explain why you chose a particular data structure, algorithm, or approach — not just what the code does.
3

Trade-Off Transparency

Every decision has trade-offs. Acknowledge what your approach does well and where it falls short, so others can evaluate or improve on your solution.
4

Readable Code

Use meaningful variable names, consistent indentation, and inline comments. Clean code is the most important form of documentation because it speaks for itself.
5

Audience Awareness

Tailor your level of detail to your audience. A teacher grading your project needs different context than a teammate who will maintain your code.
✦

KEY TAKEAWAY

Think of presenting a program like handing someone a recipe. The code is the list of ingredients and steps, but a great recipe also tells you why you use olive oil instead of butter (a design choice), warns you that the sauce might burn if you use high heat (a trade-off), and tells you to preheat the oven first (clear instructions). Without those extras, even a perfect recipe can lead to a kitchen disaster.

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.

Anatomy of a Program Presentation1 · PROJECT TITLE & PURPOSEWhat does this program do?2 · SETUP INSTRUCTIONSHow to install & run the program3 · USAGE EXAMPLESSample inputs & expected outputs4 · DESIGN CHOICESWhy you chose this approach5 · TRADE-OFFS & LIMITATIONSWhat could be improved?6 · THE CODE ITSELFWell-commented, readable sourceREADME.mdSections 1–5 live hereInline CommentsExplain the "why" in code
This flowchart shows the six key components of a program presentation. Sections 1 through 5 typically appear in a README file (shown on the left), while Section 6 — the source code — uses inline comments (shown on the right) to explain the reasoning behind individual code decisions.

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

Before you write a comment, ask yourself: "Does this explain why I wrote this line?" If it only restates the code in English, delete it. Comments that merely echo code add clutter without adding value.

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.

Common Design Trade-Offs in Python ProjectsList vs. DictionaryList: ordered, simple to iterateDictionary: fast key-based lookup✓ Choose list when order matters✗ List search is slow: O(n)✓ Dict search is fast: O(1)One Function vs. Many FunctionsOne large function: quick to writeMany small functions: easier to test✓ Small functions = reusable✗ More functions = more planning✓ Easier debugging per functionHardcoded vs. User InputHardcoded: predictable, less codeUser input: flexible, needs validation✓ Hardcoded = simpler to test✗ Hardcoded = inflexible✓ User input = broadly usefulSimple Output vs. Formatted OutputSimple: print() calls, fast dev timeFormatted: tables/colors, polished UX✓ Simple = less code to maintain✗ Simple = harder to read output✓ Formatted = professional look
Four common trade-off pairs encountered in Python mini-projects. Each card compares two approaches, listing their strengths (green checkmarks) and weaknesses (red crosses). When presenting your program, you would reference cards like these to justify your choices.

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?

You may see notation like 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. 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 Game followed 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. 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 as pip install colorama and explain what it is used for.
    Setup: Python 3.8+, no external libraries, run with python quiz.py
  3. 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. 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. 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 used random.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. 6

    Step 6 — Add Inline Comments to the Code

    Inside quiz.py, add comments that explain why, not what. For the scoring logic you might write: # Increment score only for exact matches to keep grading strict above the line if 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

If you follow these six steps for every project, your deliverable will look professional and complete. Think of it as packaging a gift: the code is the present, but the README is the wrapping, tag, and instructions that make it meaningful to the person who opens it.

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.

ComponentPoor ExampleStrong 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

A poor presentation forces the reader to guess; a strong presentation removes guesswork entirely. The difference is not talent — it is effort and structure. Following the six-component template consistently will put your work in the "strong" column every time.

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 SkillProfessional Equivalent
README with title and purposeProject documentation site (e.g., Read the Docs, GitHub Wiki)
Setup instructions in READMEAutomated setup scripts, Docker containers, CI/CD pipelines
Usage examples with sample I/OAPI documentation with request/response examples (e.g., Swagger)
Documented design choicesArchitecture Decision Records (ADRs) maintained in version control
Trade-off acknowledgementDesign review meetings, RFC (Request for Comments) documents
Inline comments and docstringsAuto-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

In AP Computer Science and college-level courses, you will be expected to write formal design documents before you even start coding. These documents are essentially expanded versions of the README's "Design Choices" section. Starting that practice now, even informally, makes the transition much smoother.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

A classmate submits a Python project with the following README: "This is my project. Run it with Python." Identify at least three specific pieces of information that are missing and explain why each one matters.
Show answer
First, there is no description of what the program actually does — a reader has no idea whether it is a game, a calculator, or something else. Second, the setup instructions are vague; "Run it with Python" does not specify the Python version, the exact filename to run, or whether any external libraries are needed. Third, there are no usage examples, so the reader cannot verify whether the program is working correctly. Additional missing elements include documented design choices and acknowledged trade-offs, both of which demonstrate understanding and help future developers.

Question 2: BASIC CALCULATION

Rewrite the following poor inline comment to make it useful. The code line is: scores = {} # create a dictionary. Write a replacement comment that explains why the dictionary is used.
Show answer
A strong replacement comment would be: 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

You are building a to-do list program. You have two options for storing tasks: (A) a plain text file where each line is one task, or (B) a JSON file where each task is a dictionary with keys for "task", "priority", and "done". Write a two- to three-sentence trade-off statement comparing these options, using the template: "I chose [A/B] over [A/B] because [reason]. The downside is [limitation], but [justification]."
Show answer
A strong answer might read: "I chose the JSON file (Option B) over the plain text file because JSON allows each task to store structured data like priority and completion status alongside the task description. The downside is that reading and writing JSON requires importing the json library and adds a few extra lines of code compared to simple file I/O. However, this trade-off is worthwhile because structured data makes it easy to sort tasks by priority and filter for incomplete items without complex string parsing." This answer names both options, states the benefit, acknowledges the cost, and justifies the decision.

Question 4: APPLIED

Imagine you have finished a Python program that converts temperatures between Fahrenheit and Celsius. Write a complete README section titled "Design Choices" that includes at least two specific decisions you made and the reasoning behind each one. Your program uses functions, takes user input, and loops until the user types "quit".
Show answer
A strong answer would include something like: "Design Choices: (1) I separated the conversion logic into two functions — fahrenheit_to_celsius() and celsius_to_fahrenheit() — rather than writing the formulas directly in the main loop. This separation makes the code easier to test and reuse. If I later wanted to add Kelvin conversions, I could add a new function without modifying existing code. (2) I used a while loop that continues until the user types 'quit' instead of asking 'Do you want to convert another?' after each conversion. This keeps the interface cleaner and reduces repetitive prompts, though it means the user must know to type 'quit' — which I addressed by printing the instruction at the start of each session." Each design choice names the alternatives, states the reasoning, and notes any downsides.

Question 5: CRITICAL THINKING

A professional developer argues: "Good code is self-documenting — if your variable names and functions are clear enough, you don't need comments or a README." Do you agree or disagree? Write a paragraph that takes a position, cites at least two specific scenarios from this lesson to support your argument, and acknowledges the strongest counterargument.
Show answer
While clear variable names and well-structured functions do reduce the need for some inline comments, code alone cannot communicate everything a reader needs to know. For example, setup instructions — such as the required Python version and run command — cannot be embedded in code; they must appear in a README. Similarly, trade-offs between design alternatives (like choosing a dictionary over a list for O(1) lookup) are invisible in the code itself; only documentation can explain the reasoning behind that choice. The strongest counterargument is that excessive or redundant comments actually harm readability by cluttering the code, and this is a valid concern. The solution is not to eliminate documentation but to write comments and READMEs that focus on 'why' rather than 'what.' Self-documenting code and thoughtful documentation are complementary, not mutually exclusive.

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.

Varsity Tutors • Computer Programming 1 (Python) • Presenting Finished Programs