Skip to content
DevMeme
5768 of 7590
CS Fundamentals Post #6324 · source on Telegram

A Visceral Explanation of FIFO vs. LIFO Data Structures

Description

This is a two-panel, black-and-white line-drawn comic that provides a graphic analogy for fundamental computer science data structures. In the first panel, labeled 'FIFO' (First-In, First-Out), a person wearing glasses and a tie is sitting calmly on a toilet, looking at their phone. This illustrates a queue, where items are processed in the order they arrive, similar to normal digestion. In the second panel, labeled 'LIFO' (Last-In, First-Out), the same person is shown bent over the toilet, vomiting. This illustrates a stack, where the last item added is the first one to be removed, grimly analogized to the last meal eaten being the first to be expelled. The humor lies in applying abstract, sterile data structure concepts to a messy, universal human biological function, creating a memorable, if crude, mnemonic

Comments

10
Anonymous ★ Top Pick A perfect visual metaphor for a message queue calmly processing events (FIFO) versus an unhandled exception bubbling up the call stack (LIFO)
  1. Anonymous ★ Top Pick

    A perfect visual metaphor for a message queue calmly processing events (FIFO) versus an unhandled exception bubbling up the call stack (LIFO)

  2. Anonymous

    Pro tip: when your Friday deploy causes enough back-pressure, even the most robust engineer will switch from Kafka-style FIFO ingestion to stack-unwinding LIFO - right into porcelain stdout

  3. Anonymous

    After 20 years in the industry, I've finally found the perfect metaphor for explaining to junior devs why our legacy message queue system occasionally processes events out of order - turns out someone implemented it as a LIFO when the bathroom was under maintenance

  4. Anonymous

    This perfectly captures why you should never implement a LIFO bathroom queue in production - sure, the theoretical performance characteristics look identical to FIFO, but the practical implementation details and user experience are... significantly different. It's the kind of architectural decision that looks fine in the design doc but causes serious problems when you actually have to maintain it. Also explains why senior engineers always insist on understanding the full context before choosing between a stack and a queue

  5. Anonymous

    FIFO: Smooth dequeues. LIFO: When your last push causes a stack overflow in the pipes

  6. Anonymous

    The only system that auto-switches between FIFO and LIFO under load is the human GI scheduler - rollback latency approaches zero

  7. Anonymous

    System design doc says FIFO; PagerDuty enforces LIFO - when backpressure turns into overflow, you debug like a stack and pray the flush is O(1)

  8. @AiayiaY 1y

    Didn't see memes for devs for a while.... It seems these memes are all about the same old stuff that they've used to joke way before

  9. @mihanizzm 1y

    So, people implement a stack and a queue simultaneously. People are doubly linked lists?

  10. @BenKillsYouu 1y

    It's an accounting meme as well! We do have "First In First Out" for those products that contain spoilage materials in it, while on the other side, we have "Last In First Out" for those products that don't get used any spoilage materials in it like chairs, tables and etc.

Use J and K for navigation