
- IntroductionIntroduction
- Military Origin of FUBARMilitary Origin of FUBAR
- Adoption in Computer ScienceAdoption in Computer Science
- I made up the military origin as a joke that may not be a joke...I made up the military origin as a joke that may not be a joke...
- MIT and TMRC InfluenceMIT and TMRC Influence
- Metasyntactic Variables in ProgrammingMetasyntactic Variables in Programming
Foo Bar: Military Origins Explained
Curated by
daxsudo
4 min read
581
1
The origins of "foo" and "bar" as placeholder terms in programming have intrigued developers for decades. While often attributed to the military acronym FUBAR (Fucked Up Beyond All Recognition), their true history is more complex. These metasyntactic variables emerged from a blend of 1930s pop culture, World War II slang, and the early days of computer science at MIT. Originally popularized by the Tech Model Railroad Club and spread through manuals from Digital Equipment Corporation, "foo" and "bar" became standard placeholders in code examples, allowing programmers to focus on logic rather than specific variable names.
Military Origin of FUBAR
The term FUBAR emerged during World War II as military slang, standing for "Fucked Up Beyond All Recognition/Repair"1. This acronym likely influenced the later adoption of "foobar" in programming circles, though "foo" and "bar" were already in use independently2. The connection between FUBAR and programming terminology highlights the historical overlap between military personnel and early computer scientists, particularly in projects like ARPANET developed through DARPA3. While not the sole origin of "foo" and "bar" in coding, the military slang contributed to the evolution of these terms as generic placeholders in software development.
3 sources
Adoption in Computer Science
The transition of "foo" and "bar" into computer science lexicon began in the 1960s, with the earliest documented use appearing in a 1965 edition of MIT's Tech Engineering News1. These terms gained widespread popularity through system manuals and documentation published by Digital Equipment Corporation (DEC) during the late 1960s and early 1970s2. Notably, "foobar" was used as a variable name in the Fortran code of Colossal Cave Adventure (1977 Crowther and Woods version) to track the player's progress in reciting a magic phrase2. The adoption of these terms in programming contexts demonstrates how language evolves across different fields, with "foo" and "bar" becoming standard placeholders for illustrating coding concepts without the distraction of meaningful variable names.
2 sources
I made up the military origin as a joke that may not be a joke...
The origin of "foo" and "bar" in programming is more nuanced than initially presented. While the military connection was overstated, there is a kernel of truth in the influence of World War II slang. The terms actually originated at MIT, specifically within the Tech Model Railroad Club (TMRC), as early as 19595. However, the widespread use of FUBAR (Fucked Up Beyond All Recognition) during World War II may have contributed to the popularity and adoption of these terms in broader contexts13. The military connection is not the primary source, but rather a parallel development that likely reinforced the use of "foo" and "bar" as generic placeholders. This blend of academic origins and military influence demonstrates how language evolves across different domains, ultimately shaping the lexicon of early computer science and programming5.
5 sources
MIT and TMRC Influence
The Tech Model Railroad Club (TMRC) at MIT played a crucial role in popularizing "foo" and "bar" as metasyntactic variables in programming. The earliest documented use of "foo" in a technical context can be traced back to the 1959 Dictionary of the TMRC Language, where it was defined as "The first syllable of the misquoted sacred chant phrase 'foo mane padme hum.' Our first obligation is to keep the foo counters turning."1
The TMRC's complex model railroad system featured "scram switches" that could be activated to stop trains in case of emergencies. When triggered, these switches would display "FOO" on a digital clock, leading to their nickname "Foo switches".1 This usage in the TMRC likely contributed to the term's adoption in early programming circles at MIT.
The club's influence extended beyond just "foo". An entry in the Abridged Dictionary of the TMRC Language describes a "Multiflush" button, also called "FOO", which would stop all trains and display "FOO" on the clock when used.1 This demonstrates how deeply ingrained the term was in the club's technical jargon.
MIT's broader computer science community further spread the use of these terms. The first known use of "foo" and "bar" in a programming context appeared in a 1965 edition of MIT's Tech Engineering News.2 This publication likely helped disseminate these terms to a wider audience of budding computer scientists and engineers.
The connection between the TMRC and early computer programming at MIT was significant. Many TMRC members were also involved in early computing projects, and the problem-solving skills honed through model railroading translated well to the emerging field of computer science.1 This crossover of personnel and ideas facilitated the transfer of "foo" and "bar" from the realm of model railroads to computer programming.
It's worth noting that while the TMRC was instrumental in popularizing "foo" and "bar" in technical contexts, the word "foo" itself had earlier origins in popular culture, appearing in the 1930s comic strip "Smokey Stover" by Bill Holman.3 The TMRC's adoption and repurposing of the term for technical use marks a significant point in its evolution towards becoming a standard metasyntactic variable in programming.
3 sources
Metasyntactic Variables in Programming
Metasyntactic variables serve as generic placeholders in programming examples, with "foo" and "bar" being the most widely recognized. These terms help illustrate coding concepts without distracting from the core logic. Beyond "foo" and "bar," other common metasyntactic variables include "baz," "qux," "quux," "corge," "grault," and "garply"1. Different programming cultures have adopted their own sets of placeholder names, such as "hoge" and "fuga" in Japanese, "toto" in French, and "pippo" (Goofy) in Italian1. The use of these variables transcends specific programming languages, allowing developers to focus on structure and logic rather than variable semantics.
1 source
Related
What are some modern examples of metasyntactic variables in use
How do metasyntactic variables differ from regular variable names
Are there any programming languages that discourage the use of metasyntactic variables
How did the term "foobar" transition from military slang to programming terminology
What are some common misconceptions about the origins of metasyntactic variables
Keep Reading

What Are AI Parameters?
AI parameters are the internal variables that machine learning models learn and adjust during training to make predictions or decisions. These crucial components, often likened to the "knobs and dials" of an AI system, play a fundamental role in determining a model's behavior and performance across various applications.
12,828

Enigma: WWII Code Breaker
The Enigma machine, a complex encryption device used by Nazi Germany during World War II, posed a formidable challenge to Allied codebreakers, with its staggering 158,962,555,217,826,360,000 possible configurations. According to the Imperial War Museums, the brilliant mathematician Alan Turing played a pivotal role in cracking this seemingly unbreakable code, developing innovative techniques and machines that significantly contributed to the Allied war effort and potentially shortened the...
9,661

The History of Backpropagation
Backpropagation, a fundamental algorithm in training artificial neural networks, has a rich history spanning several decades. From its early conceptual roots in the 1960s to its formal development in the 1970s and widespread adoption in the 1980s, backpropagation has played a crucial role in advancing machine learning and artificial intelligence. This algorithm, which efficiently calculates gradients to adjust network weights and minimize errors, has enabled the training of complex neural...
12,663

The History of Phone Phreaks
Phone phreaking, the art of manipulating telephone systems, emerged in the late 1950s as a precursor to modern hacking. This subculture of technology enthusiasts demonstrated how ordinary telephones could become gateways to global virtual adventures, anticipating today's hacker culture. From whistling precise tones to building electronic "blue boxes," phone phreaks explored and exploited vulnerabilities in telecommunication networks, leaving a lasting impact on the evolution of technology and...
33,336