To Delete or Complete? (WIP)
This blog is a wip. Please email me any feedback.
I met a founder today who said he writes 10,000 lines of code a day now thanks to AI. This is probably the limit case. He’s a hotshot programmer, he knows AI tools very well, and he’s talking about a 12 hour day. But he’s not naive. This is not 10,000 lines of bug-filled crap.
We’re already well into the age of token verbosity which I wrote about last year. Shipping 10,000 lines of C-B+ quality code per day is now trivial. Inevitably this surfaces a new issue that’s already infecting SWEland like the bubonic plague. C-grade code is slop, its hard to maintain and no good enough engineer would (or should) approve it during code review. It actually hard (and taxing) to find pockets of C-grade code amidst a forest of 10,000 lines. It’s easier to relate when you see a real example of slop in the wild.
Frontier models know how to write good code so you most likely won’t find individual blocks of code that are poorly written. For example this escape logic in packages/solid/src/server/rendering.ts:35-86 from the SolidJS source code could’ve been written better when we review it in isolation. I want to make the distinction that I don’t believe LLM’s are making this kind of mistake very often and since this still passes tests, it’ll most likely go unnoticed. Thanks ryansolid for the example.
// these methods are duplicates from solid-js/web
// we need a better solution for this in the future
function escape(s: any, attr?: boolean) {
const t = typeof s;
if (t !== "string") {
if (!attr && t === "function") return escape(s());
if (!attr && Array.isArray(s)) {
for (let i = 0; i < s.length; i++) s[i] = escape(s[i]);
return s;
}
if (attr && t === "boolean") return String(s);
return s;
}
const delim = attr ? '"' : "<";
const escDelim = attr ? """ : "<";
let iDelim = s.indexOf(delim);
let iAmp = s.indexOf("&");
if (iDelim < 0 && iAmp < 0) return s;
let left = 0,
out = "";
while (iDelim >= 0 && iAmp >= 0) {
if (iDelim < iAmp) {
if (left < iDelim) out += s.substring(left, iDelim);
out += escDelim;
left = iDelim + 1;
iDelim = s.indexOf(delim, left);
} else {
if (left < iAmp) out += s.substring(left, iAmp);
out += "&";
left = iAmp + 1;
iAmp = s.indexOf("&", left);
}
}
if (iDelim >= 0) {
do {
if (left < iDelim) out += s.substring(left, iDelim);
out += escDelim;
left = iDelim + 1;
iDelim = s.indexOf(delim, left);
} while (iDelim >= 0);
} else
while (iAmp >= 0) {
if (left < iAmp) out += s.substring(left, iAmp);
out += "&";
left = iAmp + 1;
iAmp = s.indexOf("&", left);
}
return left < s.length ? out + s.substring(left) : out;
}
Where I’ve been seeing slop become problematic is when the number of LLM-generated lines starts to increase. Slop becomes a serious problem at the macro-stage rather than micro. Here’s a FastAPI backend as an example.