Logo
UDP: I might have your packets, who knows?
  • 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
4 months ago 112.5M 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

Software Engineer Funny Co-Worker Description Definition T-Shirt

Software Engineer Funny Co-Worker Description Definition T-Shirt

Affiliate
$21.95
If we are going to unionize, fuck increased wages, I want this instead

If we are going to unionize, fuck increased wages, I want this instead

Backend
32.0K views 3 years ago
Looks like it's displaying the right information to me

Looks like it's displaying the right information to me

Programming
269.2K views 4 years ago