Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2009-08-15 10:42:09

MathsIsFun
Administrator
Registered: 2005-01-21
Posts: 7,535

Programming Joke

A programmer is sent to the supermarket with instructions to "buy butter and if they have eggs then buy a dozen."

Returning with 12 butters, the programmer says, "they had eggs".


"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

#2 2009-08-15 11:32:14

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 84,400

Re: Programming Joke

Hi MathsisFun;

I think he did the right thing.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

#3 2009-08-15 20:01:17

Tigeree
Member
Registered: 2005-11-19
Posts: 13,847

Re: Programming Joke

It took me a while to get it but that's pretty kool! My friend got an email about something like that...


People don't notice whether it's winter or summer when they're happy.
~ Anton Chekhov
Cheer up, emo kid.

Offline

#4 2010-01-23 06:42:02

John E. Franklin
Member
Registered: 2005-08-29
Posts: 3,562

Re: Programming Joke

Good One!  (read it 6 months late)


igloo myrtilles fourmis

Offline

#5 2010-02-23 08:31:16

crystal123
Member
Registered: 2010-01-07
Posts: 9

Re: Programming Joke

i dont get it
im only young thats why
someone explain it plz wink

Offline

#6 2010-02-23 08:33:09

crystal123
Member
Registered: 2010-01-07
Posts: 9

Re: Programming Joke

roflol         roflol          roflol
     
          roflol          roflol

roflol            roflol        roflol

        roflol               roflol

Offline

#7 2010-02-28 01:24:28

bob farey
Guest

Re: Programming Joke

crystal,

It is not a very good joke.

"buy butter and if they have eggs then buy a dozen."

Coders are seen as pedantic persons with absolutely no common sense. This coder was told definitely to buy butter. He was then told that if they have eggs, buy a dozen. The stupid coder thought "the condition IF THEY HAVE EGGS has been met, so I must follow the next instruction, which is buy a dozen. Only an idiot would think that buy a dozen referred to butter. This is because eggs come in dozens, and are a normal purchase, and nobody would buy 12 packs of butter....

#8 2010-02-28 02:33:08

Devantè
Real Member
Registered: 2006-07-14
Posts: 6,400

Re: Programming Joke

Way to go?

Offline

#9 2010-02-28 04:11:36

mathsyperson
Moderator
Registered: 2005-06-22
Posts: 4,900

Re: Programming Joke

Hey, it's not the programmer's fault if he got bad instructions.


Why did the vector cross the road?
It wanted to be normal.

Offline

#10 2010-03-02 08:28:32

Sarah Rebekah 13
Guest

Re: Programming Joke

Very good Joke Funny Toroflol

#11 2010-03-03 07:04:56

misheeru
Member
Registered: 2010-02-18
Posts: 4,594

Re: Programming Joke

why is this a joke? I would have done the same thing.... wouldn't everyone have done that too?  I no get it  >_<


Of Moons, Birds and Monsters

Offline

#12 2010-03-04 08:39:47

Sarah Rebekah 13
Guest

Re: Programming Joke

I dont know.

#13 2010-03-09 05:06:50

bob farey
Guest

Re: Programming Joke

buy butter is a specific instruction, so pop a block into your basket

and      means more instructions are coming


if they have eggs     means  if there are eggs on sale, chicken duck or ostrich, it doesn't matter, read the next instruction
if there are no eggs on sale, you have finished, proceed to checkout

buy a dozen          means I don't want 6 or 24   now proceed to checkout

#14 2010-03-09 09:04:22

Sarah Rebekah 13
Guest

Re: Programming Joke

Hum why i didt come up with the answer

#15 2010-03-09 09:25:27

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 3,843

Re: Programming Joke

bob farey wrote:

if they have eggs     means  if there are eggs on sale

Why now limit the eggs to those that are on sale? That adds a constraint to the original instructions.

Last edited by phrontister (2010-03-09 10:24:23)


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#16 2010-03-09 10:21:30

Sarah Rebekah 13
Guest

Re: Programming Joke

Yes I Agree.

#17 2010-03-09 10:51:12

misheeru
Member
Registered: 2010-02-18
Posts: 4,594

Re: Programming Joke

>_>

<_<

>_<

it looks like everyone gets it except me...

^_^

oh well


Of Moons, Birds and Monsters

Offline

#18 2010-03-10 03:49:46

Sarah Rebekah 13
Guest

Re: Programming Joke

Dont be sad.:)

#19 2010-03-10 05:28:55

misheeru
Member
Registered: 2010-02-18
Posts: 4,594

Re: Programming Joke

hahahaa, thanks big_smile


Of Moons, Birds and Monsters

Offline

#20 2010-03-11 06:50:38

Sarah Rebekah 13
Guest

Re: Programming Joke

You are welcome:)

#21 2010-06-07 06:11:10

KrazyKyngeKorny
Member
Registered: 2010-06-07
Posts: 12

Re: Programming Joke

I knew a fellow, early twenties, who aspired to be a professional programmer.

He showed me some code for a program he was writing (BASIC).

At one point he had code like

if x < 10 then
if x < 8 then
    (code)
else if x < 5 then
    (code)

Unfortunately, much of this sort of thing goes on in professional programming.

Offline

#22 2010-07-05 05:10:29

jk22
Member
Registered: 2010-06-14
Posts: 33

Re: Programming Joke

programmers have noticed it's much easier to program an automatic insult generator than a worship generator.

and that death of people was always the same : enough money was put in the bet, that it was worth programming the death of with certainty : take bill with the more money corresponding, say the cause.

Last edited by jk22 (2010-07-05 05:20:06)

Offline

#23 2010-08-24 16:20:22

hiyatran
Member
Registered: 2010-08-19
Posts: 5

Re: Programming Joke

misheeru wrote:

>_>

<_<

>_<

it looks like everyone gets it except me...

^_^

oh well

apparently, I'm in the same boat as you...

Offline

#24 2011-12-01 18:23:53

DaveRobinsonUK1
Member
Registered: 2011-12-01
Posts: 12

Re: Programming Joke

KrazyKyngeKorny wrote:

I knew a fellow, early twenties, who aspired to be a professional programmer.

He showed me some code for a program he was writing (BASIC).

At one point he had code like

if x < 10 then
if x < 8 then
    (code)
else if x < 5 then
    (code)

Unfortunately, much of this sort of thing goes on in professional programming.

Yeah! tell me about it. I work with artists who think because they have learned how write a small script
they are somehow equivalent to god. Not only do they do things like this, they also NEVER comment their
code. Then to add further complication they needlessly split functions out into separate files. Also they
don't document or provide test data for the program. As a result when you come to make some changes
you have to go through the whole thing line by line. They don't seem to understand the concept of making
it work on paper before going anywhere near a keyboard.

These people are a menace and have no business being in charge of a programming language.down


I see it, but I don't believe it.

Offline

#25 2011-12-01 21:13:53

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 84,400

Re: Programming Joke

Hi DaveRobinsonUK1;

Calm down Dave. Thoughts like that only elevate your blood pressure. They do not change the way they work.

But between you and I, you are absolutely correct.

They don't seem to understand the concept of making
it work on paper before going anywhere near a keyboard.

I did not think anyone coded like that anymore or even knew about it.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

Board footer

Powered by FluxBB