Skip to content
DevMeme
2172 of 7590
CS Fundamentals Post #2424 · source on Telegram

The Three Hard Problems of Programming, with an Off-by-One Error

Description

A screenshot of a tweet from user Laurie (@laurieontech). The tweet presents a classic computer science joke with a clever twist. It reads, 'There are only two hard problems in programming: 1. Naming 3. Off by one errors 2. Race conditions'. The humor operates on multiple levels for developers. First, it plays on the well-known aphorism about the two hardest things being 'cache invalidation and naming things.' Second, it explicitly lists 'Off by one errors' as a hard problem while simultaneously demonstrating one by stating there are 'two' problems but listing three. The intentionally jumbled numbering (1, 3, 2) adds to the chaotic humor, making it a perfectly crafted meta-joke that resonates with anyone who has ever debugged these exact types of issues

Comments

21
Anonymous ★ Top Pick The original list only had two problems, but the PR to add 'cache invalidation' had a merge conflict, and now we have this race condition
  1. Anonymous ★ Top Pick

    The original list only had two problems, but the PR to add 'cache invalidation' had a merge conflict, and now we have this race condition

  2. Anonymous

    The list is accurate: 1 grabbed the naming mutex, 3 skipped the boundary check, and 2 lost the scheduler race - just another day in prod

  3. Anonymous

    The fourth hard problem is explaining to the PM why fixing the race condition that only happens in prod requires more than "just adding a mutex somewhere"

  4. Anonymous

    This joke perfectly encapsulates the irony of software engineering: we can build distributed systems that handle millions of requests per second, yet we still manage to number a list incorrectly while explaining why numbering things is hard. It's the programming equivalent of a linguist making a typo while discussing grammar - except in our case, the typo ships to production and takes down the payment processing system at 3 AM

  5. Anonymous

    Two hard problems: naming and race conditions - the third item is just the off‑by‑one you get when the list is enumerated with a non‑atomic counter under contention

  6. Anonymous

    When your loop index escapes the lock, even the bullet numbers become eventually consistent - so “two” hard problems deterministically evolves into three

  7. Anonymous

    Self-demonstrating proof: the list's off-by-one swap sneaks in a third hard problem while claiming only two

  8. @coleale 5y

    по русскому можно??

    1. @Twentyminuteadventure 5y

      В программировании есть только 2 сложные проблемы: 1. Именование 3. Ошибки в граничных условиях 2. Состояние гонки

      1. @coleale 5y

        фига 2ое сложное ! спасибо)))

      2. @sonder21 5y

        можно обратно на английском))

      3. @dfgprg 5y

        правильность перевода п.3 под сомнением

        1. @Twentyminuteadventure 5y

          https://ru.m.wikipedia.org/wiki/%D0%A1%D0%BE%D1%81%D1%82%D0%BE%D1%8F%D0%BD%D0%B8%D0%B5_%D0%B3%D0%BE%D0%BD%D0%BA%D0%B8

  9. @Ahmed_K_3301 5y

    Fk translation bots

  10. @chupasaurus 5y

    Cache invalidation beats 2 and 3 imo

  11. @dengleo 5y

    3 значит не работает без ошибки, а не то что вы там мелите

    1. dev_meme 5y

      english please. Since the situation isn't getting better regarding this, I'm gonna introduce a warning system, and you're its first target. yaay warning 1/3 for @dengleo warning removed, see down below

      1. @dengleo 5y

        Wtf??? I've translated this meme

        1. dev_meme 5y

          if you're translating something into Russian, please mark it as a translation. I unfortunately can't translate every foreign text I see. Suffice to say, your warning is removed.

      2. @dengleo 5y

        And what will it be with 3 warnings?

        1. dev_meme 5y

          we'll see when that happens to someone. I hope it won't.

Use J and K for navigation