MichaelW wrote:It’s common practice among some programming elitists and wannabe elitists. Programmers started using foo and bar for the same reason that some kids use leetspeak in places where it is not appropriate.
foo and bar as established cultural standards for programmers to express generic versions of things. They appear in examples across languages etc., making these examples clearer by removing application-specific information.
I guess it's just like all those elitists who use HTTP instead of allowing any message for asking for stuff off the net, or all those elitists who teach their kids the language spoken by everyone else, instead of allowing them to fumble around with noises.
Bar, on the other hand, has multiple well-established meanings, including some that are commonly used in programming. I have a Webster’s dictionary from 1979 that lists 23 meanings for the noun bar. To most people bar is a great deal less abstract than X, Y, A, B, etc. The educational system preconditions people to expect names like X, Y, A, B, etc to represent abstract variables, and in the absence of a good reason to do otherwise, these are the sort of names that should be used.
Perhaps this is true, though, maybe we should replace all "bar"s with "baz"s (I don't think X and Y are good choices for abstract variables since they are commonly used for co-ordinates. For example, you would expect a variable x_bar to be the average horizontal co-ordinate, showing the weakness of both our points)
Anyway, I'm not arguing against context-bound examples, or examples which use metasyntactic variables other than foo and bar, I'm just saying don't slight the usefulness of foo and bar, or remove foo...bar examples from the wiki, just go ahead and add a context-based example to every wiki page. No-one is going to stand in your way.