The Chaotic History of "GOTO" (and How I Learned It on an IBM PS/2)

2026年9月3日1 次浏览来源:Dev.to阅读原文

Every programming language has that one feature everyone warns you about.

In QBASIC, C, C++, and C#, that feature is .

It’s the original source of spaghetti code, infinite loops, debugging nightmares, and childhood trauma.

And yes — I learned it the same way many of you did: On an IBM PS/2 with a 286 CPU, running DOS, with QBASIC baked right in.

This post is a mix of history, nostalgia, and a reminder that sometimes the best way to learn control flow is to break everything. 🧱 C — The Original Chaos Engine (1972) C introduced because early systems programming needed raw, unfiltered control over execution.

No exceptions.

No structured error handling.

Just: jump here, jump there, jump anywhere and try not to crash the kernel In C, is fast, simple, and dangerous.

It literally moves the instruction pointer to a labeled location.

This is the birthplace of infinite loops and spaghetti code.

C didn’t discourage it.

C basically said: “Here’s a chainsaw.

Don’t cut your leg off.” Spoiler: everyone cut their leg off. 🧱 C++ — The Sinner With Classes (1985) C++ inherited from C because backward compatibility mattered.

But C++ also introduced: exceptions, RAII, ~destructors, and structured control flow So became less necessary and more of a “you probably shouldn’t” tool.

Still valid.

Still dangerous.

Still used in: kernel code, embedded systems, performance‑critical loops, and error cleanup paths But in normal C++ code? “If you see , someone is either a genius or a criminal.” 🧱 C# — The Modern Language That Kept It (2002) C# kept for two reasons: ✔️

1.

Switch‑case control C# doesn’t allow implicit fallthrough like C/C++.

So you can do: ✔️

2.

Label jumps inside methods C# allows: But the official vibe is: “We put it here for completeness.

Please don’t use it unless you’re doing something weird.” It’s rarely used outside: switch navigation, state machines, code generation, intentionally cursed demos, and nostalgia trips 🧱 QBASIC — Learned on an IBM PS/2 Because It Literally Came With It Here’s the part that matters to me — and maybe to you too.

I learned on an IBM PS/2 with a 286 CPU — one of those chunky CRT‑powered machines that booted straight into DOS.

The PS/2 came with QBASIC because DOS came with QBASIC, so all you had to do was type QBASIC at the prompt and suddenly you were writing code that should’ve been illegal.

The glow of that CRT, the hum of the power supply, and the clack of the Model M keyboard made every GOTO STARTMENU feel like real magic.

QBASIC didn’t teach me good habits, but it taught me how control flow really works — and how to debug spaghetti nightmares decades before I ever touched C#.

This was programming in the wild.

No functions.

No structure.

Just labels, jumps, and pure DOS‑gremlin energy. 🧠 What I Learned From All This It’s not a keyword I use in real production code — but it’s a keyword that shaped how I think about code.

And honestly?

I’m glad I learned it the messy way. 🔚 Conclusion is one of the oldest, weirdest, most controversial features in programming languages.

It’s been around for 50+ years, survived multiple generations of languages, and still exists today — even if most people pretend it doesn’t.

And for many of us, it started on machines like the IBM PS/2.

With a CRT.

With DOS.

With QBASIC.

With a blinking cursor and a dream.

If you’ve got your own stories, debugging nightmares, or childhood programming chaos — drop them in the comments.

I’d love to read them.

分享
Baike.dev

baike.dev helps you discover great languages, frameworks, databases, DevOps and cloud-native tools.

Quick links

About

Contribute

Found a great developer tool? Share it with the community.

Submit a tool
© 2026 baike.dev Developer EncyclopediaUpdated daily · Discover great developer tools