# When not to use a loop

> Most lists should stay written out. One test decides it: if adding a page elsewhere should change this list, loop it — and if not, do not.
>
> From the MightyBuilder documentation: https://docs.mightybuilder.ai/dynamic/when-not-to-loop

Most lists on most sites should stay written out. This page is the judgement,
because it is the one place the manual asks you to think rather than follow
steps.

## The test

**Is this list derived from something else in the site?**

If adding a page somewhere else should change this list, loop it. If not, write
it out.

That is the whole rule. Everything below is it applied.

## Write it out

**Three feature columns.** "Fast", "Local", "Yours to keep" are not
pages. They are three pieces of copy that happen to sit side by side. A loop
over three fixed things is harder to read and harder to edit, and buys nothing.

**A footer with four links.** Unless the footer should grow when you add a page
— and most should not.

**Anything with individual wording.** The moment the second item needs a
sentence the first one does not have, a loop is fighting you.

**Two of a thing.** A loop over two items is longer than the two items.

## Loop it

**A blog or news index.** The canonical case.

**A services grid that matches your service pages.** Add a service, and it
appears.

**A team page**, if each person has their own page.

**"More from this section"** at the foot of an article.

**A navigation menu that should know about a new page.**

## The cost of looping the wrong thing

A loop puts one design in one place, which sounds like it is always better. The
costs are real though:

- it is harder to read than the markup it replaces
- changing *one* item means adding a condition, which is worse than editing one
  of three divs
- a filter that matches nothing renders nothing, and an empty area is harder to
  notice than a wrong sentence

## The AI has the same rule

The builder is told this too, and will generally write markup out rather than
loop three fixed things. If it loops something you would rather see written
out — or writes out something you would rather have loop — say so, and it will
change it.
