Skill Issue Dev | Dax the Dev
open main menu

Origins of Foo and Bar

/ 4 min read
Last updated:

Origins of Foo and Bar

Foo and bar, are ubiquitous metasyntactic variables and have been a staple in computer programming and documentation for decades. Their origins, however, are shrouded in mystery and steeped in history. In this article, we delve into the fascinating story behind these seemingly innocuous terms.

Early Beginnings

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.”

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”. 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. 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. 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. 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. 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.

LISP and Project MAC

In the early 1960s, “foo” and “bar” gained popularity through their use in LISP (LISt Processing) programming language and Project MAC at MIT. The 1964 publication “The Programming Language LISP: its Operation and Applications” by Information International, Inc., included “foo” and “bar” among other metasyntactic variables such as “baz” and “qux”. This marked a significant milestone in the history of these terms.

Cultural Significance

The use of “foo” and “bar” transcended their technical origins, becoming an integral part of programming culture. They were often used in examples to demonstrate abstract concepts, such as inheritance and polymorphism, without being specific to any particular context. This tradition has been passed down through generations of programmers, with each new cohort adopting and adapting these terms.

Controversy and Criticism

Despite their widespread use, “foo” and “bar” have faced criticism for being confusing and distracting, particularly for beginners. Some argue that using descriptive names would be more effective in conveying the intended meaning, while others see the use of “foo” and “bar” as a necessary evil to avoid context-specific distractions.

Legacy and Impact

Today, “foo” and “bar” are an integral part of the programming lexicon, with their influence extending beyond technical circles. They have inspired names for conferences (Foo Camp and BarCamp), software applications (foobar2000), and even appeared in court proceedings (United States v. Microsoft Corp.).

In conclusion, the origins of “foo” and “bar” are deeply rooted in the early days of computer science, with their evolution shaped by the cultural and technical needs of programmers. While their use may be contentious, their significance in the history of programming cannot be overstated.

References