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:

    ...Often the accurate answer to a usage question begins, “It depends.” And what it depends on most often is where you are, who you are, who your listeners or readers are, and what your purpose in speaking or writing is.
    Kenneth G. Wilson (b. 1923)

    Wise Draco comes, deep in the midnight roll
    Of black artillery; he comes, though late;
    In code corroborating Calvin’s creed
    And cynic tyrannies of honest kings;
    He comes, nor parlies; and the Town, redeemed,
    Gives thanks devout; nor, being thankful, heeds
    The grimy slur on the Republic’s faith implied,
    Which holds that Man is naturally good,
    And—more—is Nature’s Roman, never to be
    scourged.
    Herman Melville (1819–1891)