Logo
The Space Jam website: Unchanged since 1996.
  • Home
  • Hot
  • Random
  • Search

Browse

  • AI AI
  • AWS AWS
  • Agile Agile
  • Algorithms Algorithms
  • Android Android
  • Apple Apple
  • Azure Azure
  • Backend Backend
  • Bash Bash
  • C++ C++
  • Cloud Cloud
  • All Categories
As an Amazon Associate ProgrammerHumor.io earns from qualifying purchases.

HTTP 418: I'm a teapot

The server identifies as a teapot now and is on a tea break, brb

HTTP 418: I'm a teapot

The server identifies as a teapot now and is on a tea break, brb

Then-chain Memes

Posts tagged with Then-chain

My Friend Didn't Know How To Use Async Sleep In Javascript, So He Wrote This Massive Chain Of .Then()

Javascript Webdev Frontend Programming
2 months ago 112.4M views 0 shares
My Friend Didn't Know How To Use Async Sleep In Javascript, So He Wrote This Massive Chain Of .Then()
Your friend just reinvented callback hell, but with extra steps. Instead of using a simple await sleep(1000) or even setTimeout , they decided to create the world's longest promise chain that looks like it's trying to reach the bottom of the Mariana Trench. The beautiful irony here is that promises were literally invented to avoid this kind of nesting nightmare. It's like someone handed them a ladder and they chose to stack chairs instead. Each .then() is probably just wrapping another promise that resolves after a delay, creating this magnificent stairway to callback heaven. Fun fact: This code probably has more indentation levels than the JavaScript spec has pages. The real kicker? A simple utility function like const sleep = ms => new Promise(resolve => setTimeout(resolve, ms)) would've saved them from this horizontal scroll of shame. But hey, at least they're consistent with their suffering!

Today's picks

Handover

Handover

Programming
172.4M views 3 days ago
Misaligned Incentives

Misaligned Incentives

AI
21.1M views 4 months ago
Just Ask It And It Gets So Much Fun

Just Ask It And It Gets So Much Fun

AI
97.8M views 2 months ago