Get the latest tech news

What is the history of the use of "foo" and "bar" in source code examples? (2012)


Why do many code examples, especially tutorials, use the names "Foo" and "Bar" so often? It is almost a standard. For example: void foo(char* bar) { printf("%s", bar); }

has a definite and probably irreplaceable position in our language, although we fear that the excessive use to which it is currently subjected may well result in its falling into an early (and, alas, a dark) oblivion. The professor, having covered the front side of the blackboard, set the handle that operates the lift mechanism, turning meanwhile to the class to continue his discussion. Dick Gruen had a device in his dorm room, the usual assemblage of B-battery, resistors, capacitors, and NE-2 neon tubes, which he called a "foo counter."

Get the Android app

Or read this on Hacker News

Read more on:

Photo of History

History

Photo of use

use

Photo of bar

bar

Related news:

News photo

Correlation between swearwords and code quality in open-source code? (2023) [pdf]

News photo

Microsoft to face higher competition scrutiny in Germany, including over its use of AI

News photo

What to read this weekend: The history of overhyped tech, and a new graphic novel from Charles Burns