Skip to content
DevMeme
3322 of 7590
CodeQuality Post #3646 · source on Telegram

A Visual Explanation of Why 'goto' is Considered Harmful

Description

This is a two-part meme that visually critiques the 'goto' command in programming. The top text sets up the scenario: 'Junior: what's wrong with goto command?'. The bottom text, 'goto command:', is followed by two photos of a modern concrete building with a bizarre and dangerous architectural feature. On the building's windowless facade, high above the ground, are several doors. A close-up reveals two of these doors are connected by a steep, ladder-like bridge, leading from one nonsensical exit to another. The meme uses this absurd and unsafe design as a perfect metaphor for the 'goto' statement. In programming, 'goto' allows for unstructured jumps in the code's execution flow, which can create 'spaghetti code' - a tangled, unreadable, and unmaintainable mess, much like the pointless and perilous path on the side of the building

Comments

14
Anonymous ★ Top Pick The architect must have been a C programmer from the 70s. That's not a fire escape; it's an unhandled exception path
  1. Anonymous ★ Top Pick

    The architect must have been a C programmer from the 70s. That's not a fire escape; it's an unhandled exception path

  2. Anonymous

    Every time someone drops a goto into a 50-module service, an SRE has to build a Grafana dashboard just to find where that door in mid-air actually lands

  3. Anonymous

    The same architect who designed these buildings later became a senior engineer and now maintains our authentication service - explains why every login attempt somehow ends up in the billing module

  4. Anonymous

    The goto statement: because sometimes you need to explain to a junior why Dijkstra wrote 'Go To Statement Considered Harmful' in 1968, and why we're still having this conversation 55 years later. It's the architectural equivalent of building a staircase that connects two doors at completely different elevations on perpendicular walls - technically functional, but a maintenance nightmare that makes every code reviewer question your life choices and the structural integrity of your entire codebase

  5. Anonymous

    goto turns your control‑flow graph into a fire escape that ends mid‑air; the kernel calls it “goto out” for cleanup - everyone else calls it Friday pager duty

  6. Anonymous

    goto is the architectural equivalent of welding a fire escape mid‑air - the compiler accepts the edge, but your control‑flow graph and your on‑call won’t

  7. Anonymous

    Goto: 100% reliable jumps, 0% refactor survival rate - like a monolith's fire escape straight to legacy hell

  8. @Roman_Millen 4y

    Ouch.

  9. Deleted Account 4y

    RIP safety.

  10. @sashakity 4y

    this is wierdly accurate

  11. @ZgGPuo8dZef58K6hxxGVj3Z2 4y

    😂😂😂😂😂😂

  12. Deleted Account 4y

    That's a real photo?

  13. @CcxCZ 4y

    From https://vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/

  14. @doodguy1991 4y

    Goto is better than writing long ass function that will be called only once

Use J and K for navigation