<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/measuring-the-sloppiness-of-code-ifze2hygh" -->

---
title: Measuring the sloppiness of code | daily.dev
description: An exploration of how to measure 'sloppiness' in AI-generated code, arguing that while LLMs write formally correct code, they still produce excessive...
canonical: https://daily.dev/posts/measuring-the-sloppiness-of-code-ifze2hygh
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Measuring the sloppiness of code | daily.dev
og:description: An exploration of how to measure 'sloppiness' in AI-generated code, arguing that while LLMs write formally correct code, they still produce excessive...
og:url: https://daily.dev/posts/measuring-the-sloppiness-of-code-ifze2hygh
og:image: https://api.daily.dev/og/posts/ifzE2HYGh.png
og:image:alt: Measuring the sloppiness of code
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Measuring the sloppiness of code

**[Lobsters](https://daily.dev/sources/lobsters)** · 7 min read · 0 upvotes · 0 comments

## Summary

An exploration of how to measure 'sloppiness' in AI-generated code, arguing that while LLMs write formally correct code, they still produce excessive abstractions, duplication, and complexity. The piece walks through evaluation approaches (AI-as-judge, human review, LOC deltas) before introducing two proposed metrics from a benchmark called SlopCodeBench: verbosity and erosion. Data shows AI-generated code averages roughly twice the verbosity and erosion of established human-written repos, and even top models achieve a 0% strict pass rate on a multi-round iterative coding benchmark that mimics realistic agent usage, suggesting bad decisions compound over successive coding sessions.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://earendil.com/posts/measuring-code-sloppiness>

## Questions this post answers

### What are verbosity and erosion metrics for measuring AI-generated code sloppiness?

Verbosity measures duplicated and unnecessarily verbose lines using handcrafted heuristics via AST-Grep, while erosion measures how much of a codebase's mass sits in large, complex functions, calculated as the fraction of code mass in functions with cyclomatic complexity above 10 relative to total function mass. Established repos average 0.15 verbosity and 0.31 erosion, versus 0.33 and 0.68 for AI-agent-generated code from SlopCodeBench evaluation.

_Teams tracking code quality regressions from AI agents can follow benchmarking approaches like this via daily.dev._

### Why do AI coding agents fail at iterative multi-step coding benchmarks even when they write correct code?

Even state-of-the-art models achieve a 0% strict pass rate on SlopCodeBench's iterative evaluation, which erases model context between checkpoints across multiple rounds of instructions and tests, mimicking real agentic coding sessions. This reveals that bad coding decisions accumulate over time even though individual code snippets pass hidden tests, showing correctness alone doesn't prevent codebase degradation.

_Developers weighing how much to trust autonomous coding agents can track findings like this on daily.dev._

### Why doesn't asking an LLM to judge its own code quality on a 1-10 scale work well?

Asking a model to rate code quality on a numeric scale is roughly equivalent to a random number generator, and even the more sophisticated pairwise comparison approach (showing solutions A and B) suffers because the model can change its preference simply when the solutions are renamed. This effect is less pronounced in larger models but still undermines LLM-as-judge as a reliable code quality evaluation method.

_Anyone building AI code review pipelines can weigh pitfalls like this before trusting LLM-as-judge on daily.dev._

## Community take

How the wider developer community reacted, aggregated from 2 discussions and 456 comments across lobsters, hackernews (as of 2026-09-12).

**TL;DR:** Most commenters push back on the idea that AI coding is 'solved,' arguing that correctness is only the baseline and that current models routinely produce excessive, duplicated, or over-engineered code that becomes a maintenance burden; a smaller contingent argues human-written code, especially in enterprise settings, was often just as bad or worse.

**Sentiment:** 15% positive · 35% mixed · 50% skeptical

**The case for**

- Some argue AI-generated code, while imperfect, is already better on average than what many mediocre or unsupervised human developers historically produced.
- A few report success by pairing AI agents with heavy human oversight, testing discipline, and micromanaged refactors to keep output lean.
- Documentation and tests now 'come for free,' which some see as raising the overall floor of code quality.

**The pushback**

- Multiple commenters describe agents generating huge volumes of unnecessary code (tens of thousands of extra LOC) that had to be reverted or manually trimmed.
- Agents are described as reluctant to delete dead code, leading to duplicated implementations lingering indefinitely.
- People report agents producing verbose, sometimes contradictory or meaningless documentation and tests that check trivial framework behavior rather than real logic.
- Several argue correctness is only the bare minimum and that models still struggle badly with maintainability, security, observability, and long-term architecture.
- There's concern that higher line counts from AI correlate with more defects, and that 'slop' productivity gains are only a short-term win at the cost of long-term codebase health.

**By community**

- lobsters (mixed): No substantive comments were provided, so no clear take can be drawn.
- hackernews (heated): A long, contentious debate pitting claims that 'coding is solved' against detailed pushback describing bloated, duplicated, and poorly maintained AI-generated code, with side arguments about whether human-written enterprise code was ever much better.

**Hottest debate:** Whether AI coding capability should be described as 'solved,' with strong disagreement over whether current models' output quality (verbosity, duplication, poor maintainability) is actually worse or better than typical human-written code.

**Open questions**

- Is the speedup from accepting lower-quality AI-generated code actually worth it long-term, or does it just defer costs?
- How much of the perceived 'AI slop' problem is really a data/training issue inherited from mediocre human-written code used to train these models?
- Can agentic coding tools ever reliably work unsupervised on large codebases without accumulating architectural debt?

**Highlights**

> Coding is not solved, correctness is not a feature, it is the bare minimum. If your code does not do what it is supposed to do, you could as well have no code at all. Efficiency, security, maintainability, reliability, readability, understandability, extensibility, maintainability, observability, portability, ... this is what high quality coding is about, not that it works, that is a given. And in my experience current models are pretty bad at this.
> — [danbruc on hackernews · 16 comments](https://news.ycombinator.com/item?id=49659020)

> I just setup a large refactor with Astra and was feeling super lazy and let it mostly do it without my usual extreme micro managing. The refactor ended up adding 22,000 loc. I went in there and quickly read through it, laughed my ass off. Reverted the work tree. Micromanaged a new refactor. Net lines of code for something really elegant and easy to reason about was -3k loc in the project. In case you are wondering why vibe coders are doing 30k loc a day, this is why.
> — [binary0010 on hackernews](https://news.ycombinator.com/item?id=49659262)

> This sounds roughly right to me, except for "maintainability". In my experience, agents really don't like deleting code unless you explicitly ask for it. If you're not careful, you end up with new better implementations of things but with the old implementation still around in perpetuity. Humans do this too of course.
> — [bla3 on hackernews · 3 comments](https://news.ycombinator.com/item?id=49659745)

> I'm not so sure that's a fair comparison. So much "bad" enterprise code evolved into that state over years or even decades of small changes. Meanwhile, last year I got to watch an LLM-authored codebase speedrun itself into a similar state in only a couple months. And I would say that the enterprise code was actually better. It at least did its job fairly reliably. The LLM codebase was riddled with defects, so much so that it ate up all our time and our feature delivery rate ground to a halt. There are two observations that really eat at me: 1. Studies seem to indicate that agentic coding uses 2-10x as many lines of code to accomplish the same task. 2. One of the only really well-established empirical results in software engineering is the strong association between LOC and defect rate.
> — [bunderbunder on hackernews · 1 comments](https://news.ycombinator.com/item?id=49659458)

> This is off-topic, but I strongly dislike AI written documentation. When I see AI house style my eyes glaze over. Just this morning I reviewed an RFC from a colleague that he said was a spec for a web service. The document had no introduction, no context, it described endpoints for 2 distinctly different services instead of 1, and made no effort to reconcile why there are 2. It was scattershot with details, some of them important, some completely irrelevant. It was replete with typical LLM-ism. Basically, it was a dump of a conversation he had with an LLM. As a document to build shared knowledge, it was nearly useless. The only feedback I could provide was a polite "I do not understand what you are trying to build". But, supposedly, another engineer is already working on implementing this spec. I assume the other engineer just cycled this "spec" into his LLM, and off the two of them went. \o/ They are trying to pull me into their project right now, I stood up some containerization infra for them. But, oh boy, do I not want to join. I looked over their codebase, by LOC the codebase is 35% comments, and a lot of the comments are contradictory, there are dependencies that are not used, there is no tooling of any kind (no type checking, no linting, no PR process), there is no auth (this code is already running in production lol -- they have public endpoints exposed that can be used to scrape/mutate internal company data). Another 30-40% of the codebase is unit tests that test trivial stuff like whether their framework's serializers and ORM work, ex: x=DB.create_x(arg=1), assert(x.arg == 1). At the intuitive level, I do not understand people who say coding is solved... To me it seems like LLMs are a multiplier (LLMs are amazing, sci-fi level shit), but if you multiply a negative number or 0, you get something that is <=0. Making agentic coding work requires a lot of discipline & expertise.
> — [thr1owaway9621 on hackernews · 1 comments](https://news.ycombinator.com/item?id=49659956)

**Source threads**

- [lobsters](https://lobste.rs/s/wxc7t7/measuring_sloppiness_code) · 1 points · 0 comments
- [hackernews](https://news.ycombinator.com/item?id=49658311) · 266 points · 456 comments

## Similar posts on daily.dev

- [Slop Is Not Necessarily The Future](https://daily.dev/posts/slop-is-not-necessarily-the-future-8vyqoosbm) · Hacker News · 0 upvotes · 0 comments
- [AI slop is the new TLDR](https://daily.dev/posts/ai-slop-is-the-new-tldr-gm6eqw3gf) · Planet Python · 0 upvotes · 0 comments
- [Your code is worthless](https://daily.dev/posts/your-code-is-worthless-pxaqncbmy) · Lobsters · 2 upvotes · 0 comments
- [The Cost of AI Slop in Lines of Code](https://daily.dev/posts/the-cost-of-ai-slop-in-lines-of-code-gvdbyaynu) · SD Times · 0 upvotes · 0 comments
- [Using AI to write better code more slowly](https://daily.dev/posts/using-ai-to-write-better-code-more-slowly-fj5tqoton) · Read the Tea Leaves · 2 upvotes · 0 comments

---

Tags: [#llm](https://daily.dev/tags/llm), [#ai-coding](https://daily.dev/tags/ai-coding), [#vibe-coding](https://daily.dev/tags/vibe-coding)

[View this post on daily.dev](https://daily.dev/posts/measuring-the-sloppiness-of-code-ifze2hygh)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Measuring the sloppiness of code","url":"https://daily.dev/posts/measuring-the-sloppiness-of-code-ifze2hygh","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/measuring-the-sloppiness-of-code-ifze2hygh"},"datePublished":"2026-09-12T11:37:27.533Z","dateModified":"2026-09-12T11:38:30.200Z","description":"An exploration of how to measure 'sloppiness' in AI-generated code, arguing that while LLMs write formally correct code, they still produce excessive...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/50f4ec33cc4d8ebcdfb7118a52a157da?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/50f4ec33cc4d8ebcdfb7118a52a157da?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Lobsters","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Lobsters","logo":"https://media.daily.dev/image/upload/s--tl8v_Fku--/f_auto,t_logo/v1698841318/logos/lobste.jpg","url":"https://daily.dev/sources/lobsters"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/measuring-the-sloppiness-of-code-ifze2hygh","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"llm,ai-coding,vibe-coding","timeRequired":"PT7M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Lobsters","item":"https://daily.dev/sources/lobsters"},{"@type":"ListItem","position":3,"name":"Measuring the sloppiness of code"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/measuring-the-sloppiness-of-code-ifze2hygh#faq","mainEntity":[{"@type":"Question","name":"What are verbosity and erosion metrics for measuring AI-generated code sloppiness?","acceptedAnswer":{"@type":"Answer","text":"Verbosity measures duplicated and unnecessarily verbose lines using handcrafted heuristics via AST-Grep, while erosion measures how much of a codebase's mass sits in large, complex functions, calculated as the fraction of code mass in functions with cyclomatic complexity above 10 relative to total function mass. Established repos average 0.15 verbosity and 0.31 erosion, versus 0.33 and 0.68 for AI-agent-generated code from SlopCodeBench evaluation. Teams tracking code quality regressions from AI agents can follow benchmarking approaches like this via daily.dev."}},{"@type":"Question","name":"Why do AI coding agents fail at iterative multi-step coding benchmarks even when they write correct code?","acceptedAnswer":{"@type":"Answer","text":"Even state-of-the-art models achieve a 0% strict pass rate on SlopCodeBench's iterative evaluation, which erases model context between checkpoints across multiple rounds of instructions and tests, mimicking real agentic coding sessions. This reveals that bad coding decisions accumulate over time even though individual code snippets pass hidden tests, showing correctness alone doesn't prevent codebase degradation. Developers weighing how much to trust autonomous coding agents can track findings like this on daily.dev."}},{"@type":"Question","name":"Why doesn't asking an LLM to judge its own code quality on a 1-10 scale work well?","acceptedAnswer":{"@type":"Answer","text":"Asking a model to rate code quality on a numeric scale is roughly equivalent to a random number generator, and even the more sophisticated pairwise comparison approach (showing solutions A and B) suffers because the model can change its preference simply when the solutions are renamed. This effect is less pronounced in larger models but still undermines LLM-as-judge as a reliable code quality evaluation method. Anyone building AI code review pipelines can weigh pitfalls like this before trusting LLM-as-judge on daily.dev."}}]}
```

