# Log lines that narrate each step ("Starting...", "Successfully saved")

*Comments and text*: one of the ways AI coding agents bloat software, from lessloc's [pattern catalog](https://lessloc.org/patterns/index.md). lessloc catches it as [`narration`](https://lessloc.org/guide/reference.md#tier-3) (three or more in a file).

## What makes log lines that narrate each step a bad practice?

The standard that calls it a bad practice: Raymond, *The Art of Unix Programming*, Rule of Silence: "When a program has nothing surprising to say, it should say nothing".

## What does lessloc do about log lines that narrate each step?

lessloc catches it as [`narration`](https://lessloc.org/guide/reference.md#tier-3) (three or more in a file).

- `narration` (tier 3): Comments that narrate the code, decorate it or restate a name, closing-brace comments, and log lines that narrate each step.

## Examples

Caught as `narration`:

```js [bd.js]
export async function sync(db) {
  console.log("Starting sync...");
  const rows = await db.all();
  console.log("Fetched rows");
  await db.save(rows);
  console.log("Successfully saved");
}
```

Written well:

```js [bd.js]
export async function sync(db) {
  const rows = await db.all();
  await db.save(rows);
  console.log(`synced ${rows.length} rows`);
}
```

## Related patterns

The other patterns in [Comments and text](https://lessloc.org/patterns/index.md#comments-and-text):

- [Comments that narrate what the code does](https://lessloc.org/patterns/narration.md): lessloc catches it as `narration`.
- [Banners, dividers, closing-brace comments, emoji decoration](https://lessloc.org/patterns/decoration.md): lessloc catches it as `narration`.
- [Docs that restate the name](https://lessloc.org/patterns/restating-docs.md): lessloc catches it as `narration`.
- [History and messages to the requester](https://lessloc.org/patterns/history.md): lessloc catches it as `history`.
- [Comment blocks and comment-heavy changes](https://lessloc.org/patterns/comment-weight.md): lessloc catches it as `comment-block` and `comment-density`.
- [Docs that still name what a change removed](https://lessloc.org/patterns/stale-doc.md): lessloc catches it as `stale-doc`.
- [Summary, report and notes files](https://lessloc.org/patterns/index.md#report-files): lessloc catches it as `junk-file` and refuses it before it lands.
- [Doc files and README growth nobody asked for](https://lessloc.org/patterns/unrequested-docs.md): lessloc catches it as `unrequested-doc`.
- [Docs deleted wholesale to shrink a change](https://lessloc.org/patterns/doc-removed.md): lessloc catches it as `doc-removed`.
- [Always-loaded instructions that grow](https://lessloc.org/patterns/long-instructions.md): lessloc catches it as `long-instructions`.
- [Commit messages that recap the diff file by file](https://lessloc.org/patterns/commit-recaps.md): The commit hook warns when a message lists the files the diff shows.
