Why foo and bar in every tutorial i read?

P

P.J. Plauger

Why these used as variable name? any story?

They derive from FUBAR, an old US Navy acronym for "Fucked
up beyond all repair." The term had considerable currency
at MIT going back at least half a century, AFAIK. Toot
hackers were the first people I knew of who distilled out
foo and bar as generic identifiers.

HTH,

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com
 
K

Kenny McCormack

Why these used as variable name? any story?

I do not believe that either "foo" or "bar" are mentioned anywhere in the
C standard(s) document(s). Therefore, your post is off-topic in
comp.lang.c.
 
R

Randy Howard

Kenny McCormack wrote
(in article said:
I do not believe that either "foo" or "bar" are mentioned anywhere in the
C standard(s) document(s). Therefore, your post is off-topic in
comp.lang.c.

:)
 
W

Walter Roberson

I do not believe that either "foo" or "bar" are mentioned anywhere in the
C standard(s) document(s). Therefore, your post is off-topic in
comp.lang.c.

"bar" is used in the Rationale description of trigraphs,
in discussing the 9 ASCII characters not present in ISO 646.

I haven't found "foo" though.
 
P

P.J. Plauger

"bar" is used in the Rationale description of trigraphs,
in discussing the 9 ASCII characters not present in ISO 646.

I haven't found "foo" though.

I did my best to excise all instances of foo and bar in the original
draft C Standard. (Otherwise, you would have found several.) I think
the Rationale left my hands by the time the trigraphs happened.
(Otherwise, you wouldn't have found that "bar".)

P.J. Plauger
 
R

Richard Heathfield

Walter Roberson said:
"bar" is used in the Rationale description of trigraphs,
in discussing the 9 ASCII characters not present in ISO 646.

I haven't found "foo" though.

It's on line 745 of my copy of the C89 draft:

"The abstract, the foreword, the examples, the footnotes, the"
 
O

ozbear

I did my best to excise all instances of foo and bar in the original
draft C Standard. (Otherwise, you would have found several.) I think
the Rationale left my hands by the time the trigraphs happened.
(Otherwise, you wouldn't have found that "bar".)

P.J. Plauger

Why?

Oz
 
C

CBFalconer

ozbear said:
.... snip ...

Why?

I suspect he considers such slang ill suited to an international
standard. Just as we consider excess abbreviations (u, plz, etc.)
unsuited to c.l.c.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>
 
T

tmp123

Kenny said:
I do not believe that either "foo" or "bar" are mentioned anywhere in the
C standard(s) document(s). Therefore, your post is off-topic in
comp.lang.c.

According to google, comp.lang.c group description is something like
"discussions about C".
No references about "C standards".
Thus, the post agrees the description and is valid (in particular, I
found it interesting).
 
K

Kenny McCormack

According to google, comp.lang.c group description is something like
"discussions about C". No references about "C standards". Thus, the post
agrees the description and is valid (in particular, I found it
interesting).

Stick around for a few minutes. You'll find out the truth.
 
J

Jordan Abel

I suspect he considers such slang ill suited to an international
standard.

Why? It's a valid identifier, not "slang". Any particular reason to
choose "i" or "n" over "foo" and "bar"?
 
K

Kenneth Brody

tmp123 wrote:
[...]
According to google, comp.lang.c group description is something like
"discussions about C".
No references about "C standards".
Thus, the post agrees the description and is valid (in particular, I
found it interesting).

(1) Who says that Google's description is correct?

(2) "Discussions about C" does not imply "discussions about every
extension to C ever written on any platform".

--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody/at\spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Don't e-mail me at: <mailto:[email protected]>
 
A

Al Balmer

According to google, comp.lang.c group description is something like
"discussions about C".
No references about "C standards".

Have you informed Google of their mistake?
 
D

Default User

tmp123 said:
According to google, comp.lang.c group description is something like
"discussions about C".
No references about "C standards".
Thus, the post agrees the description and is valid (in particular, I
found it interesting).

Those who persist in posting off-topic messages, and the ones you
reference are, will find themselves shunned by the majority of the
participants. If your goal is to talk to no one except Kenny and Rod
and the other trolls, keep on what you're doing.



Brian
 
K

Keith Thompson

tmp123 said:
[...]

According to google, comp.lang.c group description is something like
"discussions about C".
No references about "C standards".

Google is not Usenet, and Google definitely doesn't get to decide what
this newsgroup is about.
Thus, the post agrees the description and is valid (in particular, I
found it interesting).

I find discussions of handbells, science fiction, and electoral
politics interesting, but I would object to any such discussions in a
newsgroup that discusses standard C.

A number of people seem to think that we shouldn't discourage
discussions of non-standard features in comp.lang.c. Jack Klein has
written a good refutation of this idea; see
<http://groups.google.com/group/comp.lang.c/msg/1460ed5b9ad3dae1?hl=en>.
 
M

Mark McIntyre

According to google, comp.lang.c group description is something like
"discussions about C".

Google have absolutely no clue what they're talking about, in that
case. Heck, they just make it up based on the title I expect. They
probably think that alt.sex.tv is for discussions about roman numbers
on the telly.
No references about "C standards".
Thus, the post agrees the description and is valid (in particular, I
found it interesting).

Its not. The topic of this group is clearly defined.
Mark McIntyre
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,261
Messages
2,571,041
Members
48,769
Latest member
Clifft

Latest Threads

Top