Foobar - Usage in Code

Usage in Code

The terms are very often used in programming examples, much like the Hello World program is commonly used as an introduction. For example, foo and bar might be used to illustrate a simple string concatenation:

/* C code */ #include int main { char *foo = "Hello"; char *bar = "World!"; printf("%s %s\n", foo, bar); return 0; } /* PHP code */ $foo = 'Hello'; $bar = array($foo, ' ', 'world', '!'); echo implode('', $bar);

Additional examples of the use of foo and bar in code are given in the entry on metasyntactic variables.

Read more about this topic:  Foobar

Famous quotes containing the words usage and/or code:

    Girls who put out are tramps. Girls who don’t are ladies. This is, however, a rather archaic usage of the word. Should one of you boys happen upon a girl who doesn’t put out, do not jump to the conclusion that you have found a lady. What you have probably found is a lesbian.
    Fran Lebowitz (b. 1951)

    ... the self respect of individuals ought to make them demand of their leaders conformity with an agreed-upon code of ethics and moral conduct.
    Mary Barnett Gilson (1877–?)