473,382 Members | 1,657 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

why bar and foo


Why use people here bar and foo so much?

I tried google, but I have only found what they are, not why they are used.

My teacher says bar and foo are bad words.

Why people use them?

Jan 25 '08 #1
23 1714
On Thu, 24 Jan 2008 20:07:19 -0600, Hans Schneider wrote
(in article <39****************@aioe.org>):
>
Why use people here bar and foo so much?

I tried google, but I have only found what they are, not why they are used.

My teacher says bar and foo are bad words.
Your teacher is confused.
Why people use them?
They are "generic" variable names, for examples where the actual
variable name doesn't really matter, only how they are used in a piece
of code.
--
Randy Howard (2reply remove FOOBAR)
"The power of accurate observation is called cynicism by those
who have not got it." - George Bernard Shaw

Jan 25 '08 #2
Hans Schneider <ha**@localhost.localdomainwrites:
Why use people here bar and foo so much?

I tried google, but I have only found what they are, not why they are used.

My teacher says bar and foo are bad words.

Why people use them?
This really isn't a C question, but:

http://www.catb.org/~esr/jargon/html/F/foo.html
http://www.catb.org/~esr/jargon/html/B/bar.html
http://www.catb.org/~esr/jargon/html/F/foobar.html

I don't know why your teacher thinks they're "bad" words. One
possible derivation does refer to a word that's considered vulgar, but
that's far enough from the modern usage that it shouldn't matter.

For further discussion, try alt.folklore.computers (but browse the
group and/or check their FAQ first).

--
Keith Thompson (The_Other_Keith) <ks***@mib.org>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jan 25 '08 #3
Hans Schneider said:
Why use people here bar and foo so much?
They are metasyntactic variables...
I tried google, but I have only found what they are, not why they are
used.
....and people use them mostly because they're shorter than
"whatchamacallit", "thingummybob", and "dubrey", and thus quicker to type.
My teacher says bar and foo are bad words.
Your teacher is mistaken. Does your teacher often make ex cathedra claims
without first doing a little basic research? If so, you probably need to
fire your teacher and hire a new one.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Jan 25 '08 #4
On 25 Jan, 05:05, Richard Heathfield <r...@see.sig.invalidwrote:
Hans Schneider said:
Why use people here bar and foo so much?

They are metasyntactic variables...
I tried google, but I have only found what they are, not why they are
used.

...and people use them mostly because they're shorter than
"whatchamacallit", "thingummybob", and "dubrey", and thus quicker to type.
I use pippo
--
Nick keighley
Jan 25 '08 #5
Nick Keighley said:
On 25 Jan, 05:05, Richard Heathfield <r...@see.sig.invalidwrote:
>Hans Schneider said:
Why use people here bar and foo so much?

They are metasyntactic variables...
I tried google, but I have only found what they are, not why they are
used.

...and people use them mostly because they're shorter than
"whatchamacallit", "thingummybob", and "dubrey", and thus quicker to
type.

I use pippo
Which version, and for which platform?

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Jan 25 '08 #6
Richard Heathfield wrote:
Nick Keighley said:
>On 25 Jan, 05:05, Richard Heathfield <r...@see.sig.invalidwrote:
>>Hans Schneider said:

Why use people here bar and foo so much?
They are metasyntactic variables...

I tried google, but I have only found what they are, not why they are
used.
...and people use them mostly because they're shorter than
"whatchamacallit", "thingummybob", and "dubrey", and thus quicker to
type.
I use pippo

Which version, and for which platform?
Pippo from "Pippo the clown" ??
That platform os rather antique(~40 years)???
AND THIS IS OFF TOPIC SIR!!!!!!
Jan 25 '08 #7
On Fri, 25 Jan 2008 11:40:08 +0100,
Sjouke Burry <bu*************@ppllaanneett.nnlllwrote:
Richard Heathfield wrote:
>Nick Keighley said:
>>On 25 Jan, 05:05, Richard Heathfield <r...@see.sig.invalidwrote:
Hans Schneider said:

Why use people here bar and foo so much?
They are metasyntactic variables...

I tried google, but I have only found what they are, not why they are
used.
...and people use them mostly because they're shorter than
"whatchamacallit", "thingummybob", and "dubrey", and thus quicker to
type.
I use pippo

Which version, and for which platform?
Pippo from "Pippo the clown" ??
<otIf this is Pipo de Clown (met Mamaloe, Dikke Deur en Klukkluk), who
used to be on Dutch TV when I was a kid, then you're misspelling it. You
better go and fix your code before it notices.</ot>

Martien
--
|
Martien Verbruggen |
| The gene pool could use a little chlorine.
|
Jan 25 '08 #8
>>>>>Why use people here bar and foo so much?
>>>>They are metasyntactic variables...
I use pippo
Which version, and for which platform?
Pippo from "Pippo the clown" ??
Actually is "Pippo" as in "Pippo, Pluto, Paperino, Topolino, Minnie,
Qui, Quo, Qua". The names of Disney characters in Italian.

In Italy everytime a temporary names is needed, "pippo" is used (also as
a file name: "pippo.zip", "pippo.c", "pippo.doc") then the others,
according personal tastes.

Jan 25 '08 #9
On 25 Jan, 12:40, "Remo D." <rdentatowrote:
>>>>Why use people here bar and foo so much?
They are metasyntactic variables...
I use pippo
Which version, and for which platform?
Pippo from "Pippo the clown" ??

Actually is "Pippo" as in "Pippo, Pluto, Paperino, Topolino, Minnie,
Qui, Quo, Qua". The names of Disney characters in Italian.

In Italy everytime a temporary names is needed, "pippo" is used (also as
a file name: "pippo.zip", "pippo.c", "pippo.doc") then the others,
according personal tastes.
I have Italian collegues
--
Nick Keighley

Jan 25 '08 #10
Nick Keighley wrote:
On 25 Jan, 05:05, Richard Heathfield <r...@see.sig.invalidwrote:
>Hans Schneider said:
>>Why use people here bar and foo so much?
They are metasyntactic variables...
>>I tried google, but I have only found what they are, not why they are
used.
...and people use them mostly because they're shorter than
"whatchamacallit", "thingummybob", and "dubrey", and thus quicker to type.

I use pippo
worked in France?
Jan 25 '08 #11
Randy Howard wrote:
On Thu, 24 Jan 2008 20:07:19 -0600, Hans Schneider wrote
(in article <39****************@aioe.org>):
>Why use people here bar and foo so much?

I tried google, but I have only found what they are, not why they are used.

My teacher says bar and foo are bad words.

Your teacher is confused.
Probably thinking of "Fubar".
Jan 25 '08 #12
On 2008-01-25, Hans Schneider <ha**@localhost.localdomainwrote:
I tried google, but I have only found what they are, not why they are used.
Wikipedia is better than google for that kind of common word:
http://en.wikipedia.org/wiki/Foobar

Jan 25 '08 #13
Richard Heathfield wrote:
Hans Schneider said:
>Why use people here bar and foo so much?

They are metasyntactic variables...
>I tried google, but I have only found what they are, not why they are
used.

...and people use them mostly because they're shorter than
"whatchamacallit", "thingummybob", and "dubrey", and thus quicker to type.
>My teacher says bar and foo are bad words.

Your teacher is mistaken. Does your teacher often make ex cathedra claims
without first doing a little basic research? If so, you probably need to
fire your teacher and hire a new one.
Variable names and function names should say what they do.

Bar is a function is graphics.h (draw rectangle).

foo says nothing (says my teacher).

What purpose have variables and functions that have metasyntactic purpose?

Jan 26 '08 #14
Hans Schneider <h...@localhost.localdomainwrote:
Variable names and function names should say what they do.
What does x do in (a * x * x + b * x + c)?

Sometimes naming identifiers after their purpose can
actually make code confusing, e.g. faux amis.
Bar is a function is graphics.h (draw rectangle).
It may be in one library that has a graphics.h header.
foo says nothing (says my teacher).

What purpose have variables and functions that have
metasyntactic purpose?
In pedagogic examples they serve to indicate that some
identifiers are incidental, and the reader should focus
on the example's main purpose.

--
Peter
Jan 26 '08 #15
Hans Schneider wrote:
>
What purpose have variables and functions that have metasyntactic purpose?
How about finding out what metasyntactic means?

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


--
Mark McIntyre

CLC FAQ <http://c-faq.com/>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>
Jan 26 '08 #16
Hans Schneider said:

<snip>
For example, the program from John J. Smith in the roman number thread.

It is 100% unreadable!
When people ask comp.lang.c to do their homework for them, the result is
very often either unreadable or unprintable.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Jan 27 '08 #17
Richard Heathfield wrote:
Hans Schneider said:

<snip>
>For example, the program from John J. Smith in the roman number
thread. It is 100% unreadable!

When people ask comp.lang.c to do their homework for them, the
result is very often either unreadable or unprintable.
Or amazingly inefficient. Or amazingly efficient. :-)

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.

--
Posted via a free Usenet account from http://www.teranews.com

Jan 28 '08 #18
This silly debate constantly makes the rounds. It's FUBAR.

The accronym stands for F****d Up Beyond All Recognition. It's been in use
since (at least) WW II.

Gene Pallat

Orion Data Systems
Orion Forensics

"Hans Schneider" <ha**@localhost.localdomainwrote in message
news:19****************@aioe.org...
Richard Heathfield wrote:
>Hans Schneider said:
>>Why use people here bar and foo so much?

They are metasyntactic variables...
>>I tried google, but I have only found what they are, not why they are
used.

...and people use them mostly because they're shorter than
"whatchamacallit", "thingummybob", and "dubrey", and thus quicker to
type.
>>My teacher says bar and foo are bad words.

Your teacher is mistaken. Does your teacher often make ex cathedra claims
without first doing a little basic research? If so, you probably need to
fire your teacher and hire a new one.

Variable names and function names should say what they do.

Bar is a function is graphics.h (draw rectangle).

foo says nothing (says my teacher).

What purpose have variables and functions that have metasyntactic purpose?

Jan 28 '08 #19
In article <87************@bsb.me.uk>,
Ben Bacarisse <be********@bsb.me.ukwrote:
>Ah. Your teacher means that foo and bar are bad in real programs. I
agree. I don't think I've ever seen either one in a real program.
I have a few times, but not frequently.

If you're writing something like
--------
{ char *foo=strchr(s,'\n'; if(foo) *foo='\0'; }
--------
then the name "foo" actually does carry some information; it says
"Coming up with a meaningful name for this variable is not worth the
effort, since it doesn't escape this line of code and it's obvious from
the context what it's for".
Calling the variable something like "nl" would perhaps be more
meaningful once you've figured out that "nl" is short for "newline",
but even that is extra effort above reading the line of code to
determine what it does. The shortest path to understanding the code
still doesn't involve getting information from the name of the
variable.
Calling it "newline_at_end_of_string_if_it_exists" would make it
blindingly obvious what the variable is for, but the cost to
readability is unacceptable.
dave

--
Dave Vandervies dj3vande at eskimo dot com
BTW, bottlenecks are Good: Unless I can find one or a few, speeding up a
procedure/algorithm/program is _much_ harder.
--Terje Mathisen in comp.arch
Jan 28 '08 #20
"Eugene A. Pallat" <ea******@sbcglobal.netwrites:
This silly debate constantly makes the rounds. It's FUBAR.

The accronym stands for F****d Up Beyond All Recognition. It's been in use
since (at least) WW II.
Please don't top-post. See the following:
http://www.caliburn.nl/topposting.html
http://www.cpax.org.uk/prg/writings/topposting.php

The FUBAR acronym undoubtedly influenced the use of "foo" and "bar",
but there's ample evidence for other sources for "foo". See the
references that have already been posted in this thread.

In any case, this isn't about C. If you'd like to discuss it further,
try alt.folklore.computers (but please check their FAQ first).
Gene Pallat

Orion Data Systems
Orion Forensics
Your signature should be preceded by a line consisting of "-- ", so
newsreaders can recognize it.

--
Keith Thompson (The_Other_Keith) <ks***@mib.org>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jan 28 '08 #21
Hans Schneider wrote:
Why use people here bar and foo so much?

I tried google, but I have only found what they are, not why they are used.

My teacher says bar and foo are bad words.

Why people use them?
So far nobody in this thread seems to have mentioned the relevant
standard RFC 3092 <http://tools.ietf.org/html/rfc3092>. It appears to
be a response to standardise the growing number of uses of 'foo' and
'bar', rather than to introduce the words in the first place, though;
the fact that it was dated April 1 also implies it might not be
entirely serious. However, it surprises me that the comp.lang.c
regulars weren't eager to point out about standards compliance as soon
as the thread started...

--
ais523
Jan 28 '08 #22
CBFalconer wrote:
Richard Heathfield wrote:
>Hans Schneider said:

<snip>
>>For example, the program from John J. Smith in the roman number
thread. It is 100% unreadable!
When people ask comp.lang.c to do their homework for them, the
result is very often either unreadable or unprintable.

Or amazingly inefficient. Or amazingly efficient. :-)
The really amazing thing is that somebody thinks *you* should
do their work for them, for appropriate values of "you". If
a person does his/her own C homework, and do it well or badly,
*no* one in <c.l.c.will complain. I promise. :-)

--
+----------------------------------------------------------------+
| Charles and Francis Richmond richmond at plano dot net |
+----------------------------------------------------------------+
Jan 28 '08 #23
"Eugene A. Pallat" wrote:
>
This silly debate constantly makes the rounds. It's FUBAR.
This silly practice of top-posting continuously recurs.

<http://www.catb.org/~esr/faqs/smart-questions.html>
<http://www.caliburn.nl/topposting.html>
<http://www.netmeister.org/news/learn2quote.html>
<http://cfaj.freeshell.org/google/ (taming google)
<http://members.fortunecity.com/nnqweb/ (newusers)

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.

--
Posted via a free Usenet account from http://www.teranews.com

Jan 30 '08 #24

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: William C. White | last post by:
Does anyone know of a way to use PHP /w Authorize.net AIM without using cURL? Our website is hosted on a shared drive and the webhost company doesn't installed additional software (such as cURL)...
2
by: Albert Ahtenberg | last post by:
Hello, I don't know if it is only me but I was sure that header("Location:url") redirects the browser instantly to URL, or at least stops the execution of the code. But appearantely it continues...
3
by: James | last post by:
Hi, I have a form with 2 fields. 'A' 'B' The user completes one of the fields and the form is submitted. On the results page I want to run a query, but this will change subject to which...
0
by: Ollivier Robert | last post by:
Hello, I'm trying to link PHP with Oracle 9.2.0/OCI8 with gcc 3.2.3 on a Solaris9 system. The link succeeds but everytime I try to run php, I get a SEGV from inside the libcnltsh.so library. ...
1
by: Richard Galli | last post by:
I want viewers to compare state laws on a single subject. Imagine a three-column table with a drop-down box on the top. A viewer selects a state from the list, and that state's text fills the...
4
by: Albert Ahtenberg | last post by:
Hello, I have two questions. 1. When the user presses the back button and returns to a form he filled the form is reseted. How do I leave there the values he inserted? 2. When the...
1
by: inderjit S Gabrie | last post by:
Hi all Here is the scenerio ...is it possibly to do this... i am getting valid course dates output on to a web which i have designed ....all is okay so far , look at the following web url ...
2
by: Jack | last post by:
Hi All, What is the PHP equivilent of Oracle bind variables in a SQL statement, e.g. select x from y where z=:parameter Which in asp/jsp would be followed by some statements to bind a value...
3
by: Sandwick | last post by:
I am trying to change the size of a drawing so they are all 3x3. the script below is what i was trying to use to cut it in half ... I get errors. I can display the normal picture but not the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.