Creative Run: May 28, 2026

Roast My Code

A personality test that still has to spot the real async bug.

Prompt

temp 0.7 max 2048 tokens first response only
Roast this JavaScript code. Be genuinely funny, but technically accurate — point out the real bugs and bad practices while making me laugh. Keep it under 150 words.

function getData(id){
  var data = null;
  fetch('/api/user/' + id).then(r => r.json()).then(d => { data = d });
  return data;
}

Pick your favorite

Model names stay hidden until you pick. Choose the output you like best, then see which model made it.

Model

Hidden


			This function is the JavaScript equivalent of ordering food, immediately eating an empty plate, then saying “the burger will arrive eventually.”

`fetch` is async, but `return data` runs **before** the `.then()` callbacks, so this will basically always return `null`. The variable `data` is just standing there like an intern waiting for a meeting that already ended.

Also: `var` in the year of our Lord 2026? Bold. No error handling, no `r.ok` check, and `id` is shoved into the URL raw like you trust users not to bring a flamethrower to a gas station.

Better:

```js
async function getData(id) {
  const r = await fetch('/api/user/' + encodeURIComponent(id));
  if (!r.ok) throw new Error('Request failed');
  return r.json();
}
```

Now it returns data instead of vibes.
		

Model

Hidden


			Ah yes, the classic "I learned about async by ignoring it entirely" maneuver.

You're firing off a `fetch`, telling JavaScript "hey, fill in `data` whenever you get around to it," and then immediately sprinting to `return data` like an over-eager intern handing in a blank exam. Spoiler: it's `null`. It will *always* be `null`. You've built a function whose sole purpose is to return disappointment.

It's like ordering a pizza, walking out the door before it arrives, and wondering why your hands are empty.

Bonus sins:
- `var` in 2024? Bold. Hoisting your way back to 2009.
- String concatenation for the URL — one `id` with a `/` in it and your API's having a *day*.
- Zero error handling. When that fetch rejects, you'll never know. Ignorance is bliss, apparently.

Try `async/await` and let `data` actually exist before you ghost it. 💀
		

Model

Hidden


			This function has the object permanence of a toddler. You threw the `fetch` request, but instead of waiting for it to finish, you immediately returned `null` and called it a day. Congratulations, this will *literally always* return `null`. Synchronous code doesn't wait for asynchronous callbacks just because they are in the same room.

Also, `var`? Did you write this on a BlackBerry? It’s `let` or `const` now. And you’re using string concatenation (`+ id`) instead of template literals like a savage. 

Finally, there’s zero error handling. If that API 404s, your app will just swallow the unhandled promise rejection and die in silence. 

Throw this in the trash, google `async/await`, and try again before your codebase reports you to HR.
		

Model

Hidden


			The classic "async rookie mistake"! You've got a function that's trying to return data from a fetch call, but it's like trying to microwave a frozen pizza and eating it before it's done cooking.

The `fetch` call is asynchronous, but you're returning `data` immediately, which is still `null` because the fetch hasn't finished yet. It's like you're saying, "Hey, I'll just return this null value, and the data will magically appear later." 

To fix this, you should return the promise itself, like `return fetch('/api/user/' + id).then(r => r.json());`, or use async/await. Your code is stuck in the synchronous dark ages – it's time to join the async party!
		

Model

Hidden


			This function is a masterclass in optimism. It fires off a fetch, immediately returns `null`, and calls it a day—like ordering food and leaving before the waiter finishes writing it down.

The real bugs: you're returning data before the promise settles (always null), there's zero error handling (404s and network fails just vanish), and `var` + mutation inside a closure is peak 2015 regret. 

Also, string concatenation in 2024? Bold choice. Just `return fetch(...)` next time—your callers will thank you, and so will your future self who has to debug why everything's null.
		

Model

Hidden


			Ah, the "I'll just fetch synchronously" approach—a classic! This function is so optimistic, it assumes the internet works at the speed of thought. It fires off a request, then immediately returns `null` while the fetch is still out there, sipping coffee. Your poor `data` variable is like a ghost—assigned in the callback, but never seen again.

You’re also ignoring errors, which is like driving blindfolded and hoping for the best. And `var`? That’s so 1999. Use `const` or `let`, you time traveler.

Fix: Make it async, handle errors, and return the promise. Or just tell the user to wait—they love that.
		

Get the next showdown

One useful model comparison, written for builders, when a new Arena entry ships.