# Functions & Modularity **Track:** Foundations — Creative Coding — the existing 50 **Framework / surface:** p5.js **Level:** Beginner **Prerequisites:** Loops, Animation & the Frame Loop **In one line:** Name a behaviour once, reuse it everywhere. ## Theory, aesthetics & inspiration A function gives a name to a behavior so it can be invoked again without restatement. This is procedural abstraction — the structured-programming discipline Edsger Dijkstra and his contemporaries argued made large programs comprehensible — and it carries an aesthetic as much as an engineering virtue. To define "draw one tree" and call it across a forest is to work the way Sol LeWitt's wall-drawing instructions do: author the procedure once, let assistants or machines execute it many times and places. John Maeda's "Design By Numbers" prized this compression. A good function names a unit of intent at the right altitude, letting the artist think in gestures rather than in individual lines.