Logo
The first website is still online (info.cern.ch).
  • 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 Programming Frontend Webdev
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

Employee Vs Freelancer Vs Founder Vs Vibe Coder

Employee Vs Freelancer Vs Founder Vs Vibe Coder

Programming
291.2M views 13 days ago
If Open-Source Is So Great

If Open-Source Is So Great

Programming
289.3K views 1 year ago
If You Do This You Suck

If You Do This You Suck

Frontend
37.7K views 2 years ago