Other CMU-associated variables include gorp. These are the first words a child used to learn to spell on a Dutch spelling board. Of all these, only 'foo' and 'bar' are universal and baz nearly so. Some jargon terms are also used as metasyntactic names; barf and mumble, for example.
See also Commonwealth Hackish for discussion of numerous metasyntactic variables found in Great Britain and the Commonwealth. Wikipedia gives this definition of Metasyntactic Variable :. In computer science, programmers use metasyntactic variables to describe a placeholder name or an alias term commonly used to denote the subject matter under discussion or an arbitrary member of a class of things under discussion.
The use of a metasyntactic variable is helpful in freeing a programmer from creating a logically named variable, which is often useful when creating or teaching examples of an algorithm. The word foo is the principal example. The term "metasyntactic variable" is primarily found in informal literature. It is sometimes also used as a synonym for metavariable. Any symbol or word which does not violate the rules of the language can be used as a metasyntactic variable, but nonsense words are commonly used.
The same concept is employed in other fields where it is expressed by terms such as schematic variable see logical form. By mathematical analogy: A metasyntactic variable is a word that is a variable for other words, just as in algebra letters are used as variables for numbers.
C In the following example of the C programming language the function name foo and the variable name bar are both metasyntactic variables. Spam, ham, and eggs are the principal metasyntactic variables used in the Python programming language. In the following example the baz, foo, and bar are metasyntactic variables and lines beginning with are comments. 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 represent unknown values, typically when describing a scenario where the purpose of the unknown values are understood, but their precise values are arbitrary and unimportant. 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.
Foo has entered the English language as a neologism and is considered by many to be the canonical example of a metasyntactic variable. Eric S. Raymond has called it an "important hackerism" alongside kludge and cruft. Early versions of the Jargon File [JARGON] interpreted this change as a post-war bowdlerization, but it now seems more likely that FUBAR was itself a derivative of 'foo' perhaps influenced by German 'furchtbar' terrible - 'foobar' may actually have been the original form.
For, it seems, the word 'foo' itself had an immediate prewar history in comic strips and cartoons. Many of these people were in MIT's Tech Model Railroad Club, where we find the first documented use of "foo" in tech circles in and a variant in Both "foo" and "bar" and even "baz" were well known in popular culture, especially from Smokey Stover and Pogo comics, which will have been read by many TMRC members.
The use of lone "foo" as a nonsense word is pretty well documented in popular culture in the early 20th century, as is the military FUBAR. The Lounger thinks that this business of Foo-ism has been carried too far by its misguided proponents, and does hereby and forthwith take his stand against its abuse. It may be that there's no foo like an old foo, and we're it, but anyway, a foo and his money are some party.
Voice from the bleachers- "Don't be foo-lish! As an expletive, of course, "foo! We say alas because proper use of the word may result in such happy incidents as the following. It was an 8. 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. The front board slowly, majestically, lifted itself, revealing the board behind it, and on that board, writ large, the symbols that spelled "FOO"!
The Tech newspaper , a year earlier, the Letter to the Editor, September :. By the time the train has reached the station the neophytes are so filled with the stories of the glory of Phi Omicron Omicron, usually referred to as Foo, that they are easy prey.
It is not that I mind having lost my first four sons to the Grand and Universal Brotherhood of Phi Omicron Omicron, but I do wish that my fifth son, my baby, should at least be warned in advance. And The Tech in December :. General trend of thought might be best interpreted from the remarks made at the end of the ballots. One vote said, '"I don't think what I do is any of Pulver's business," while another merely added a curt "Foo.
Our first obligation is to keep the Foo Counters turning. The dictionary's compiler Pete Samson said in Use of this word at TMRC antedates my coming there. A foo counter could simply have randomly flashing lights, or could be a real counter with an obscure input. And from 's Jargon File 4. Earlier versions of this lexicon derived 'baz' as a Stanford corruption of bar.
He says "It came from "Pogo". Albert the Alligator, when vexed or outraged, would shout 'Bazz Fazz! Further research under a joint Foocom and Anarcom grant expanded the law to be all embracing and universally applicable: If anything can go wrong, it will! But let's remember this question is about code examples, so let's find "foo", "bar" and "foobar" published in code. So, Jargon File 4. Hart and Michael Levin:. Walter Mitty recalled on this site in I second the jargon file regarding Foo Bar.
John V. Everett recalls in When I joined DEC in , foobar was already being commonly used as a throw-away file name. Hey, if you're going to post all the non-programming related answers, why did you leave out "foo-fighter" the name WWII pilots gave to UFOs they saw and couldn't identify but presumed were enemy fighters?
Blorgbeard Blorgbeard It is used in place of an object variable or file name. Deathstalker Deathstalker 6 6 silver badges 6 6 bronze badges. I think it's meant to mean nothing. The wiki says: "Foo is commonly used with the metasyntactic variables bar and foobar. GateKiller GateKiller I like the comparison with other languages and their different meanings :-D — Matt. In my earlier days, I originally found the use of "foo" as a placement in any example to represent something as f'd-up to be confusing.
I wanted a working example, not something that was foobar. Jimmy B Jimmy B 31 2 2 bronze badges. If "everybody" knows this, why are so many people asking about the meaning of "foo", "bar" and "foobar"? Prakash is not the first person to ask. Is it just me, or is the rendering of long comments broken? Anyway, the rest was " Yeah, you exceeded your characters limit for a comment ; but thanks! I am probably just tangled too deep in the developer community ;- — khebbie.
I found and find them distracting. Especially when first trying to decipher python, I took them to be far more meaningful than they are. Maybe a function, or some part of the syntax.
I instinctively try to memorise stuff like that. To the point of writing it down. At least "kwargs" makes sense when you realise what it stands for.
Stuff like "foo" is just confusingly 'mystical'. They feel like injokes for the sake of injokes. The Overflow Blog. Does ES6 make JavaScript frameworks obsolete?
Podcast Do polyglots have an edge when it comes to mastering programming Featured on Meta. Now live: A fully responsive profile. Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams?
Learn more. Why "Foo" is so a special word? Asked 9 years, 11 months ago. Active 9 years, 11 months ago. Viewed 18k times. Improve this question. Community Bot 1. This is a duplicate of programmers. Probably got popularized by text-book writers lacking creative inspiration. Add a comment.
0コメント