You On AI Field Guide · Declarative vs Imperative The You On AI Field Guide Home
Txt Low Med High
CONCEPT

Declarative vs Imperative

The architectural distinction between describing what an outcome should look like and specifying how to produce it — the axis along which CSS filter hacks sit, tipping one way or the other depending on whether the hacker is closer to a stylesheet author or a renderer.

Declarative systems describe outcomes; imperative systems describe steps. CSS is declarative: the author writes filter: invert(1) sepia(1) and the browser figures out how to produce those pixels. A canvas-based image editor is imperative: the author writes code that loops over pixels, reads color values, computes new ones, writes them back. Filter hacks live in the declarative world, but they often express what would otherwise be imperative operations. A developer who understands both modes can reach for whichever fits the task; a developer who only knows one will stretch it into territory where the other would serve better.

Declarative vs Imperative
Declarative vs Imperative

In The You On AI Field Guide

The declarative mode has specific virtues. Stylesheets are small, legible, and amenable to authoring by humans who do not think of themselves as programmers. The browser's implementation absorbs complexity the author never has to confront: color space conversions, GPU acceleration, caching, compositing.

← Home 0%
CONCEPT Book →

Keep reading with YOU ON AI

Unlock the full book, 10,000+ field-guide entries, and a 1000+ thinker library. If you have a book code, register now — it takes a minute.

Register with book code Sign in