Comment by troupo
5 hours ago
Just because you don't look at the code, doesn't mean it doesn't produce subpar code constantly.
Opus 4.7, high effort. Literally 30 minutes ago. There's a `const UNMATCHED_MARKER = "<hardcoded value>"` that we want to remove from a file. Behold (the first version was a full on AST walk for absolutely no reason whatsoever, by the way):
function restoreUnmatchedSelectors(cssPath) {
const cssContent = readFileSync(cssPath, "utf-8");
const marker = UNMATCHED_MARKER + " ";
const count = (cssContent.match(new RegExp(escapeRegExp(marker), "g")) || []).length;
if (count > 0) {
writeFileSync(cssPath, cssContent.replaceAll(marker, ""));
return count;
}
}
function escapeRegExp(s) {
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
Don't get me started on all the code duplications, utility functions written from scratch in every module that needs them, reading full database just to count number of records...
You're doing something very wrong. Consistently get a simple sed or similar oneliner for the above, not just on Claude Opus 4.7, across several LLMs.
Maybe if you had a little more faith, you'd get better results :)