Unit 1: Programming by Design (Racket)

Framing Concept: A program is a structured solution to a problem.

Unit Overview

This unit introduces students to programming through a function-first, design-oriented approach. The goal is not just to “write code,” but to understand what makes a solution correct, clear, and adaptable. Students build mental models for inputs, outputs, structure, and testing. Using a Beginning Student Language (Racket) and the design recipe, students gain fluency in creating small, testable, purpose-driven programs that reinforce algebraic reasoning and prepare them for later work in data, control systems, and abstraction.

Essential Questions:

  • What makes a program correct?
  • How do we decompose a problem into smaller parts?
  • How do we describe what a program is supposed to do?
  • Why does testing matter, and how do we do it well?
  • What do functions have in common with mathematical expressions?

Core Learning Goals:

  • Use the design recipe: purpose statement, contract, examples/tests, definition
  • Understand and apply function composition and reuse
  • Write and test simple and piecewise functions
  • Use cond expressions to handle branching behavior
  • Understand recursion conceptually and apply it to visual or numerical patterns

Key Activities:

  • Function Design Practice: Start with simple input/output transformations, model arithmetic, unit conversion, or basic geometry
  • Flag Generator Project: Use recursive visual patterns and decomposition to model a US flag
  • Function Towers: Stack smaller functions into pipelines (function composition)
  • Visual Recursion: Draw fractal-like patterns using self-referential design
  • Peer Reviews: Students review and annotate each other’s design recipe steps

Embedded Mathematical Connections:

  • Functions as input-output rules (from Algebra 1)
  • Recursion modeled after arithmetic sequences or pattern growth
  • Piecewise definitions connected to real-world mathematical modeling
  • Building a function from a table of values or from verbal description

Stretch + Extensions:

  • Recursive Tree Generator: Visualize recursion via branching logic
  • Build-a-Bot: Design a command language for a robot with movement functions
  • Algebra Word Problem Parser: Model small parts of word problems as testable functions
  • Abstracting Repetition: Recognize patterns and create general-purpose utilities

Assessment + Reflection:

  • Design check-in: Students annotate their own thinking at each recipe step
  • Vocabulary quiz: Define function, contract, test case, recursion, abstraction
  • Code review: Present and defend a recursive or piecewise function to peers
  • Reflection: How is this different from other math you’ve done? What new habits do you notice forming?

End-of-Unit Statement: By the end of Unit 2, students should be able to write a variety of pure functions, test them meaningfully, and explain the structure of their programs. They begin to see programming not as a trick or a task, but as a structured act of problem solving. This is their first real fluency checkpoint in the course—and it sets them up to apply structure in more open-ended and data-rich settings next.