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:

    Pythagoras, Locke, Socrates—but pages
    Might be filled up, as vainly as before,
    With the sad usage of all sorts of sages,
    Who in his life-time, each was deemed a bore!
    The loftiest minds outrun their tardy ages.
    George Gordon Noel Byron (1788–1824)

    Motion or change, and identity or rest, are the first and second secrets of nature: Motion and Rest. The whole code of her laws may be written on the thumbnail, or the signet of a ring.
    Ralph Waldo Emerson (1803–1882)