Search⌘ K
AI Features

Composing a Quiz from Functions

Explore how to create understandable and well-named functions that compose smoothly using pipelines in Elixir. This lesson teaches you to shape functions for effective composition and use tokens to represent state, culminating in building a functional quiz application that tracks user progress through modular design.

Writing simplistic functions

Every program is a conversation. As programmers, our first job is to be understood. Whether we’re communicating to our future teammates or our future selves, the goals should be the same. This lesson is about writing functions that are easier to understand. Though getting better at this critical skill is a lifelong pursuit, adding specific tools to our tool belt will improve our readability immediately if we’re not already using them.

Building well-named functions

If a program is a story, functions represent the verbs, a critical part of our vocabulary. Our function arguments are nouns:

Programming is ...