foobar컴퓨터 프로그래밍이나 컴퓨터와 관계된 문서에서 가끔 쓰이는 가상의 이름이다.[1] 이 단어들은 변수, 함수, 명령어 등에서 중요하지 않고 개념 설명의 목적으로만 쓰이는 이름이다. 이 단어들은 쓰일 때 아무런 의미도 없다. foobar는 보통 혼자 쓰이고, 여러 개가 나오는 경우에는 foo, bar, baz의 순서로 사용한다.

역사와 어원편집

이 말의 기원은 확실하게 알려져 있지 않고, 몇 가지 설이 존재한다. 'foobar'는 군대에서 쓰이던 은어인 FUBAR에서 유래되었다고 알려져 있다. FUBAR란 독일어 'furchtbar'에서 나온 말로, 끔찍했던 제2차 세계 대전의 상황을 묘사하는 말로 쓰였다.

FOO is an abbreviation of Forward Observation Officer, a British Army term in use as early as the First World War.[2] The etymology of foo is explored in the Internet Engineering Task Force (IETF) Request for Comments 3092, which notes usage of foo in 1930s cartoons including The Daffy Doc (with Daffy Duck) and comic strips, especially Smokey Stover and Pogo. From there the term migrated into military slang, where it merged with FUBAR.[1]

"Bar" as the second term in the series may have developed in electronics, where a digital signal which is considered "on" with a negative or zero-voltage condition is identified with a horizontal bar over the signal label; the notation for an inverted signal foo would then be pronounced "foo bar". Bar may also be read as beyond all repair, which is how it is used in the acronym FUBAR.

The use of foo in hacker and eventually in programming context may have begun in MIT's Tech Model Railroad Club (TMRC). In the complex model system there were scram switches located at numerous places around the room that could be thrown if something undesirable was about to occur, such as a train going full-bore at an obstruction. Another feature of the system was a digital clock on the dispatch board. When someone hit a scram switch the clock stopped and the display was replaced with the word "FOO"; at TMRC the scram switches are therefore called "Foo switches". Because of this an entry in the 1959 Dictionary of the TMRC Language went something like this: "FOO: The first syllable of the misquoted sacred chant phrase 'foo mane padme hum.' Our first obligation is to keep the foo counters turning."[3]

One book틀:Which? describing the MIT train room describes two buttons by the door: labelled foo and bar. These were general purpose buttons and were often re-purposed for whatever fun idea the MIT hackers had at the time. Hence the adoption of foo and bar as general purpose variable names.

The term foobar was propagated through computer science circles in the 1960s and early 1970s by system manuals from Digital Equipment Corporation.[출처 필요]

Foobar was used as a variable name in the Fortran code of Colossal Cave Adventure (1977 Crowther and Woods version). The variable FOOBAR was used to contain the player's progress in saying the magic phrase "Fee Fie Foe Foo".

코드에서의 사용편집

이 말은 프로그래밍 예제에서 상당히 자주 쓰인다. 예를 들어, 'foo'와 'bar'는 아래에 있는, 문자열을 합치는 간단한 소스에 사용되었다.

/* C code */

#include <stdio.h>

int main()
{
   char foo[] = "Hello";
   char bar[] = "World!";
   printf("%s %s\n", foo, bar);

   return 0;
}


/* PHP code */

Namespace Foo\Bar;

class Baz {
    function Bag() {
        return __NAMESPACE__;
    }
}

use Foo;
echo Foo\Bar\Baz::Bag(); // Foo\Bar

문화에서의 사용편집

$foo 프로그래밍 매거진의 이름이다.[4] 그리고 매년 열리는 해커 컨벤션인 Foo Camp가 있다 (이 이름은 또한 이벤트의 메인 스폰서인 ). is an annual hacker convention (the name is also a backronym for Friends of O'Reilly, the event's sponsor).

During the United States v. Microsoft trial, some evidence was presented that Microsoft had tried to use the Web Services Interoperability organization as a means to stifle competition, including e-mails in which top executives including Bill Gates referred to the WS-I using the codename "foo".[5]

See also편집

References편집

  1. D. Eastlake III; 외. (2001). “Etymology of "Foo". Internet Engineering Task Force. 2007년 11월 5일에 확인함. 
  2. Extract from War Diary of 118th Siege Battery WO95/322, 1914-1918.net
  3. “Computer Dictionary Online”. , computer-dictionary-online.org
  4. Foo-magazin.de (독일어)
  5. Microsoft ploy to block Sun exposed, news.com

External links편집