"Foo" and "bar" are hacker culture signifiers, like "yo" and "word up" are hip-hop culture signifiers. Even if you don't consider yourself a part of hacker culture, understanding its history and peculiar lingo is probably a good idea if you contribute to a site known as "Hacker News".
The Jargon File, though largely historical and obsolete, is a good place to start:
The Jargon File, though largely historical and obsolete, is a good place to start:
https://catb.org/esr/jargon/