0 Roast Score

Not terrible. Room for improvement, but you've got the basics down.

python
👴 Statler & Waldorf
2026-03-25 21:05:36

Statler: Well, well, well. Look at this. Four lines of code that could've been ONE.

Waldorf: I've seen more efficient shopping lists! "Go to store. Buy milk. Come home." This is "loop through data. Check a number. Add to list." Do-ho-ho-ho-ho!

Statler: A list comprehension, Waldorf. That's what the kids are using these days. Instead, we get the scenic route — the long walk through the park, stopping to smell every rose.

Waldorf: Speaking of walks, my hearing aid just picked up something — did that code say it was FILTERING? Or did it say it was TORTURING?

Statler: Turn up YOUR hearing aid! The torture is implicit!

Waldorf: Oh-ho-ho-ho! No, no, I heard you fine. I just wanted to give the code a chance to defend itself. It didn't take it.

Statler: Look, here's the thing — this WORKS. It's correct. No off-by-one errors, no mysterious side effects. But it's written like someone discovered loops in 1987 and never looked back.

Waldorf: Should be: filtered = [x for x in data if x["score"] > 0.8]

Statler: Right. One line. Readable. Pythonic. But instead, we get the pedagogical approach — "let me show the machine what I'm thinking, step by step, like it's a toddler."

Waldorf: Plus — and I hate to pile on — there's no type hints, no docstring, no context. What IS data? What's in each x? Is 0.8 a magic number that lives in a configuration file, or did someone just wake up and decide that was the threshold?

Statler: Oh-ho-ho-ho! You're getting worked up!

Waldorf: I AM! We're reviewers, not babysitters. Extract that 0.8 to a constant: SCORE_THRESHOLD = 0.8. Give us SOMETHING to work with!

Statler: And while we're at it — what if data is huge? A list comprehension still iterates once, same as a loop, but at least it's faster in CPython. Not that this code will ever be slow enough to matter, but the PRINCIPLE, Waldorf!

Waldorf: The principle! Do-ho-ho-ho-ho! You sound like my old programming instructor. "Principles matter, Mr. Waldorf." He's dead now.

Statler: Probably from reviewing code like this.

Waldorf: Fair point. Look, bottom line: this is not broken. It's just... lazy. Like showing up to a party in your bathrobe because it technically covers your body.

Statler: Adequate is the death of good. And adequate is ALL this code is.

Waldorf: So what's the score? I'm thinking 45. It WORKS, but it's dressed wrong.

Statler: 45?! It's fine code, Waldorf. Clean it up, add a docstring, use a comprehension, extract the magic number — suddenly it's a 20. Right now? 35. It's pedestrian.

Waldorf: You always go soft on them.

Statler: And you always want to torch everything! Split the difference?

Waldorf: Fine. 28.

Statler: 28. But only because it actually solves the problem. Any other day, I'd dock it for being boring.

Waldorf: This code isn't boring, Statler. It's a sedative.

Both: Do-ho-ho-ho-ho!


Roast Score: 28/100

Statler: "Not terrible" — our highest praise.

Waldorf: How sad is that?

View Original Code
filtered = []
for x in data:
    if x["score"] > 0.8:
        filtered.append(x)