Circa 1935 as nonsense word, circa 1960 in programming sense.
detailed etymologyOriginated circa 1935 as nonsense word in Smokey Stover comic strip (1935–73) by Bill Holman (from which also foo fighter).
“fooâ€, The Jargon File
Holman states that his usage was from seeing “foo†on the base of a jade figurine in Chinatown, San Francisco, meaning “good luckâ€, presumably a transliteration of the fu character ç¦ (fú, "fortune, happiness, prosperity"),
"The History of Bill Holman", Smokey-Stover.com, Smokey Stover LLC – article by nephew of Bill Holman
"Warner Brothers Cartoon Companion"
and figurines of the trio of eponymous male "star gods" Fu Lu Shou are common in Chinese communities. Meaning influenced by fooey, fool, and feh. Used throughout the comic strip’s run, with later uses in the 1930s include The Daffy Doc (1938) and .
In computing usage, popularized by the Tech Model Railroad Club (TMRC), whose 1959 Dictionary of the TMRC Language, had an entry similar to the following, parodying the mantra Om mani padme hum (replacing om with foo):
FOO: The first syllable of the sacred chant phrase “FOO MANE PADME HUM.†Our first obligation is to keep the foo counters turning.
Related also to foobar, which is presumably derived from foo rather than the reverse.