Sunday, July 25, 2010

foobar

The terms foobar, foo, bar, and baz are common placeholder names (also referred to as metasyntactic variables) used in computer programming or computer-related documentation. They are commonly used to name variables or functions whose purpose is unimportant and serve only to demonstrate a concept. The terms can be used to represent any part of a complicated system or idea, including the data, variables, functions, and commands. The words themselves have no meaning in this usage, and are merely logical representations, much like the letters x and y are used in algebra. Foobar is often used alone; foo, bar, and baz are usually used in that order, when multiple entities are needed.



The usage in computer programming examples and pseudocode varies; in certain circles, it is used extensively, but many prefer descriptive names, while others prefer to use simple concise letters (such as A,B and a,b etc). Eric S. Raymond has called it an "important hackerism" alongside kludge and cruft.