Skip to content
DevMeme
2817 of 7590
Languages Post #3113 · source on Telegram

From feral goto to domesticated goto: control-flow evolution in modern languages

Description

The meme is split into two square photos side-by-side, framed by a thin white border. On the left is a high-contrast image of a snarling grey wolf with its mouth open, fangs exposed, ears back, and an aggressive posture. On the right is a close-up of a tan French bulldog with wrinkled face, protruding tongue, and relaxed expression. Beneath the images, the caption reads in full: "Left: A traditional goto. Right: A domesticated goto, as seen in C, C#, Golang, etc. The inability to cross function boundaries means it can still pee on your shoes, but it probably won’t rip your face off." The joke compares the notorious, unstructured goto of early C to the safer, scoped goto-like constructs available in modern languages, framing them as dangerous versus household pets. For developers, it highlights historical debates around control-flow, structured programming, and readability, while poking fun at how contemporary languages try to tame - rather than fully eliminate - problematic features

Comments

14
Anonymous ★ Top Pick We spent decades banning goto as a rabid wolf, then slipped it back in as async/await state machines - now the beast wears a cute bulldog hoodie while still chewing up our stack traces
  1. Anonymous ★ Top Pick

    We spent decades banning goto as a rabid wolf, then slipped it back in as async/await state machines - now the beast wears a cute bulldog hoodie while still chewing up our stack traces

  2. Anonymous

    The real domestication of goto happened when language designers realized that letting developers jump anywhere in code was like giving a toddler both matches and gasoline - sure, they might just light a candle, but why risk the entire codebase when you can sandbox the chaos to a single function?

  3. Anonymous

    The goto statement's journey from feral menace to house-trained nuisance perfectly mirrors our industry's approach to dangerous features: we don't eliminate them, we just add enough guardrails that they can only cause localized chaos. Modern goto is like that reformed bad boy in a rom-com - still has the edge, still makes you nervous, but at least it won't jump to your ex-girlfriend's function and wreak havoc on her stack frame

  4. Anonymous

    Go's goto: leashed to one function, so it can't hunt across the call stack - face-ripping averted, just occasional scope leaks on your shoes

  5. Anonymous

    We domesticated goto at the language level, but the compiler still emits a pack of jmp instructions - the wolf just moved into your control‑flow graph

  6. Anonymous

    “Domesticated” goto doesn’t cross function boundaries - it just encourages 1,000‑line functions with a single cleanup: label, so the wolf never has to leave the yard

  7. @RiedleroD 5y

    which brings me to the fact that I'd like to have a goto in python. Maybe in 3.11.

    1. dev_meme 5y

      But why?!

      1. @RiedleroD 5y

        to replace some more complicated loops where the exit condition changes depending on in-loop stuff. Right now, the best way to do those is a while True and breaks, which is suboptimal.

        1. Deleted Account 5y

          but where's goto helping then?

          1. @saniel42 5y

            Most people would show something like this while(){ while(){ goto endLoop; } } endLoop: whatever Never needed this though

            1. @RiedleroD 5y

              Well I don't think anyone needs it, I just think it'd be neat to have.

            2. Deleted Account 5y

              well, return from IILE should work

        2. @Agent1378 5y

          And they say php programmers are bad......

Use J and K for navigation