Why most of people using "foo" a name of variable

I have seen many forum/programmers post where people are using "foo" as a name of variable or function.. Whats the story behind it?

Haha. Foo is the first half of foobar, which is the polite spelling of fubar. Here's the lowdown:

http://en.wikipedia.org/wiki/FUBAR#In_computing_and_technology

http://en.wikipedia.org/wiki/Foobar

Khalid: I have seen many forum/programmers post where people are using "foo" as a name of variable or function.. Whats the story behind it?

It's a programmer tradition. It's a short variable name you can use when you don't want to go through the effort to come up with a descriptive variable name.

http://en.wikipedia.org/wiki/Foobar http://www.hhhh.org/hhhh/foo.html

And have you ever wondered why a lot of people use i as an index in a for loop?

Back in the day the language was Fortran, and you could only have integer variables as the loop counter. You could declare any variable as an integer but normally you didn't declare your variables. All variable names defaulted to floating point except variables that started with i, j or k. Hence in nested loops the first index was i, the next loop used j and finally if needed the third deep used k. In the days when you had to punch cards brevity was valued above clarity.

All variable names defaulted to floating point except variables that started with i, j or k.

Actually, it was (is) i through n.

Yes I remember now. :)

Although it was my first programming language the last time I used Fortran was 1974.

I am feeling really honored for getting reply/links and explanation about the "foo" from the great intellectuals here in this forum. Many many thank you to all:)