Exploring Functional Programming

A free, standards-aligned unit for high school DLCS educators

Go to Lesson Materials

Author: Wilson Gramer, Computer Science (BS) and Learning Sciences & Technologies (MS) student at Worcester Polytechnic Institute

Summary: Functional programming is a new way of thinking when writing code. Instead of organizing a program as a list of statements, larger programs are composed out of smaller ones using functions. In this 3-week unit, students will investigate functional programming patterns by implementing features in Petstagram, a social media app for pets. During this process, students will compare their implementations to procedural ways of thinking and discuss the trade-offs of each paradigm in a class presentation. The unit emphasizes student-driven exploration, group work, and reflection.

Audience: The unit is designed for students in grades 11–12 or AP with a strong programming foundation and familiarity with JavaScript. Teachers should read the content review infographic before starting the unit.

Unit learning objectives:

Students will be able to... Massachusetts DLCS standards addressed
1.  Actively employ a cycle of questioning and reflection to build understanding of unfamiliar programs and concepts. 9-12.DTC.c.1. Generate, evaluate, and prioritize questions that can be researched through digital resources or tools.
9-12.CT.d.1. Use a development process in creating a computational artifact that leads to a minimum viable product and includes reflection, analysis, and iteration.
2.  Design and iterate program functionality based on functional programming principles. 9-12.CT.d.2. Decompose a problem by defining functions, which accept parameters and produce return values.
3.  Describe programming patterns across procedural and functional representations, and justify how each representation balances trade-offs. 9-12.CT.d.4. Analyze trade-offs among multiple approaches to solve a given problem (e.g., space/time performance, maintainability, correctness, elegance).

Suggested grading: Students are graded on active participation in class and daily assignment submissions. Students are expected to demonstrate professional skills, including accountability, time management, and communication, and have an open mind to new and unfamiliar topics. The class presentation is graded according to its own rubric.