DEV Community

Adam Lewis
Adam Lewis

Posted on Originally published at prickles.org AI-assisted

Simplicity: the cap only enforces the part you can count

I've watched F4 get agreed in the retro and violated by lunchtime. The deadline closes, a parameter gets added for the next time it is needed, a helper grows a flag so one caller can opt out of half of it. Each move is rational on its own and there is no moment where anyone decides to make the codebase harder to open.

The mechanical half is easy and worth doing. Max parameters at three, a complexity limit, a hard cap on function length. A cap the build enforces doesn't get tired at 5pm and doesn't care that the release is on Friday. I run all three and they catch real tangles early.

The cap has a gap

A reviewer reading the diff sees nothing wrong. The caps can't see the generation that arrives already inside them. An agent asked to make something reusable will produce the four-parameter version from a single example. Four is under the limit. The function is short. No rule fires and the diff looks tidy.

That's the move I find hardest to reject, because accepting it feels like good taste rather than the opposite. The general version is what the shape suggests.

What requirement does this serve?

There's no default answer, which is why the linter can't ask it. Most of the time the honest answer in review is none yet. A parameter for the next time it's needed, a flag so one caller can opt out of half a helper, a config option in case someone asks.

A cap of three doesn't close that gap either. It just means the fourth parameter arrives as a name. The name hides the count.

What the cap is for

None of this is an argument against the caps. They enforce the part of simplicity you can count. A complexity limit catches the function that grew while nobody was watching. A length cap catches one that is hard.

The caps are a floor. Review holds the discipline. A person can ask the question in review, in the room. I want the version that serves the requirement in front of me, plus a note so the next person can generalise when the requirement arrives.

Agents raise the stakes

An agent takes the name and the shape at face value and builds on them. One accepted general helper becomes the vocabulary for everything https://prickles.org/tenet/simplicity/F4

Top comments (0)