NewsCrawler.org

The Big List of Slop: code patterns that are likely but add no value

The author collects coding patterns that they call slop[1]: code that is statistically likely but provides no value. The author says LLMs generate more slop than humans, and still reads the code it produces. Each pattern gets two ratings: a robot-emoji scale for how sloppy it looks, and a 😐, ☣️ or 💥 scale for how bad it is.

The MacGyver Class describes a god class[2] that cobbles a lock and a socket into a "reusable" primitive, which the author rates a ticking time bomb. Validate, Don't Parse adds runtime checks, such as asserting that a list is sorted, instead of encoding that guarantee in the type; the suggested fix is a SortedVec type. Load-bearing Façade keeps old wrappers because something claims it still needs them, and the author advises checking whether that claim holds.

Paranoia-Driven Tests check for things that never happen, and Insanity-Driven Tests check every line of a function, including logger calls. The author says the second kind takes TDD[3] to an extreme and advises deleting both kinds. Sneaky Dict Side Dish returns extra data in a dictionary instead of a typed API, and Thesaurus-Oriented Naming replaces plain names like connect with fancier ones.

Read the original ohadravid.github.ioDiscussion

Discussion

Commenters note that LLMs often leave traces of their debugging in the code, such as comments about a fix they just made. One reader has mostly seen Insanity-Driven Tests and Pinching Keystrokes in practice and asks for real examples, while another says an LLM reaches for a proper XML parser where a human might get away with a regex. A commenter quoting Hacker News says praise has shifted from clean code to readable code written by AI-enabled humans.

Sources

Published: First seen: Читать по-русски

Open as a page