Sign in to follow this  

Programmer logic in everyday life

Recommended Posts

V9s    117
229993101509365.jpg
  • Like 11

Share this post


Link to post
Share on other sites
+Odom    163

lol (Y)

Share this post


Link to post
Share on other sites
+devHead    1,723

Ah classic!! I love it! (Y)

Share this post


Link to post
Share on other sites
Ben Dyson    4

HA! Nice one :laugh:

Share this post


Link to post
Share on other sites
Hum    6,929

didn't really understand it -- oh well.

Share this post


Link to post
Share on other sites
Mystic Mungis    678

Just did a programing module in my course, people from the other group were our clients... All I can say is "THIS"

Share this post


Link to post
Share on other sites
spacer    980

It's funny because it's true. :laugh:

Share this post


Link to post
Share on other sites
+LogicalApex    1,745

didn't really understand it -- oh well.

Programmers take everything literally as our instructions to the device are literal.

So the condition as expressed literally was to bring back 6 cartons of milk if the store had eggs in stock.

A "normal" person would interpret it to mean bring back 6 eggs if they have any eggs and one carton of milk. As they would do what makes the most sense even if that isn't the literal request.

  • Like 1

Share this post


Link to post
Share on other sites
Hum    6,929

^ Oh -- I thought of the programming 'easter eggs' -- didn't see how there would be any on milk bottles.

Share this post


Link to post
Share on other sites
tsupersonic    1,325

Ha, nice one.

Share this post


Link to post
Share on other sites
Skwerl    322

I have some other good programmer jokes.

What does a programmer use for birth control?

His personality.

Why did the programmer cross the road?

Because that's what he did last year.

What's the definition of an outgoing programmer?

He stares at your feet when he talks to you instead of his own.

Share this post


Link to post
Share on other sites
threetonesun    1,205
function grocery_trip($eggs){
$milk = 1;

if($eggs){
$milk = 6;
}

return $milk;
}
[/CODE]

  • Like 1

Share this post


Link to post
Share on other sites
simplezz    864

function grocery_trip($eggs){
$milk = 1;

if($eggs){
$milk = 6;
}

return $milk;
}
[/CODE]


 :D I like the ternary operator version as well:
[code]
int
get_milk()
{
	return ( shop_has_eggs() ) ? 6 : 1;
}

Share this post


Link to post
Share on other sites
threetonesun    1,205

Ah, I was gonna use the ternary, but I figured for anyone who didn't get the joke wouldn't get that either. :laugh:

Share this post


Link to post
Share on other sites
McKay    3,695

Hahaha! If it wasn't so damn expensive to do that and it would require me to get my lazy ass back to the store, I'd do that!

Share this post


Link to post
Share on other sites
*RedBull*    608

I don't see the joke. the senario is completely logical.

6 bottles of milk bitch! that's what you asked for, suck em down!

Yeah a few more anger control classes to go to.... :/

Share this post


Link to post
Share on other sites
-Alex-    101

:D I like the ternary operator version as well:

int
get_milk()
{
	return ( shop_has_eggs() ) ? 6 : 1;
}

Just cos I want mine to be shorter :p

<? $milk = ($eggs ? 6 : 1) ?>

  • Like 1

Share this post


Link to post
Share on other sites
moloko    185

that is pretty good.

Share this post


Link to post
Share on other sites
Andrew Lyle    335

Hahaha that's good :D

Share this post


Link to post
Share on other sites
Mohitster    87

lol :D

Share this post


Link to post
Share on other sites
CPressland    176

Hahaha! Legendary!

Share this post


Link to post
Share on other sites
Ice_Blue    973

Not sure this hasn't been posted before. If it has, I apologise. (I searched before posting.)

My mother told me:

Go to the grocery store and get me two bottles of milk. If they have eggs, buy six.

When I returned, she looked inside the bag and shrieked: "Why the hell did you buy six bottles of milk?"

I replied: "Because they had eggs."

  • Like 7

Share this post


Link to post
Share on other sites
Arceles    403

Yup... I relate :D

Share this post


Link to post
Share on other sites
Arceles    403

TL:DR

#include <stdio.h>

int main(void)

{

BuyMilk = 2;

if (Eggs == TRUE) {BuyMilk = 6;}

return 0;

}

  • Like 1

Share this post


Link to post
Share on other sites
Stoffel    1,810

That was funny!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.