Show in graph
{}

Software → Programming

Function

A reusable unit of behavior that accepts inputs and may return a result.

Motivation

A function packages behavior behind a name. It solves the problem of reusing logic and giving a piece of computation a clear boundary.

Mental model

Functions are the smallest everyday abstraction in programming.

Where it fits

Function belongs to the Software track, inside Programming. It connects to nearby concepts through the graph relationships on this page and in the graph explorer.

Common mistakes

  • Making functions do too many unrelated things.
  • Hiding side effects behind innocent names.
  • Choosing names that describe implementation instead of intent.

Use the metadata panel or return to the graph to explore concepts that this one requires or relates to.